summaryrefslogtreecommitdiff
path: root/test/rinda
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 14:36:26 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 14:36:26 +0000
commit7a8329737aa011dd5624a1151c392d913457961e (patch)
tree1bf6a362455b848679a61ca285a5a2308f6279b0 /test/rinda
parentc4d2d856b85dd8e8314c82a1f7904acd18d37448 (diff)
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
Diffstat (limited to 'test/rinda')
-rw-r--r--test/rinda/test_rinda.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index d056ee2..d8eca04 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -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