Permalink
Browse files

Try interface indexes which can use for IPv6 multicast

a fix for r39896

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent c4d2d85 commit 7a8329737aa011dd5624a1151c392d913457961e @nurse nurse committed Mar 24, 2013
Showing with 13 additions and 1 deletion.
  1. +13 −1 test/rinda/test_rinda.rb
View
@@ -580,7 +580,19 @@ class TestRingFinger < Test::Unit::TestCase
def setup
@rf = Rinda::RingFinger.new
- @rf.multicast_interface = 1
+ ifindex = nil
+ 10.times do |i|
+ begin
+ addrinfo = Addrinfo.udp('ff02::1', Rinda::Ring_PORT)
+ soc = Socket.new(addrinfo.pfamily, addrinfo.socktype, addrinfo.protocol)
+ soc.setsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_IF,
+ [i].pack('I'))
+ ifindex = i
+ break
+ rescue
+ end
+ end
+ @rf.multicast_interface = ifindex
end
def test_make_socket_unicast

0 comments on commit 7a83297

Please sign in to comment.