test_rinda.rb: fix for unimplemented ifindex()
* test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6): ifindex() function may not be implemented on Windows. We use another check for the case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a75e4aef9a
commit
66ee8a1785
@ -1,3 +1,9 @@
|
|||||||
|
Mon Jun 24 22:26:31 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||||
|
|
||||||
|
* test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6):
|
||||||
|
ifindex() function may not be implemented on Windows. We use another
|
||||||
|
check for the case.
|
||||||
|
|
||||||
Mon Jun 24 22:11:37 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
Mon Jun 24 22:11:37 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||||
|
|
||||||
* test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_nolock):
|
* test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_nolock):
|
||||||
|
@ -527,12 +527,18 @@ end
|
|||||||
|
|
||||||
module RingIPv6
|
module RingIPv6
|
||||||
def prepare_ipv6(r)
|
def prepare_ipv6(r)
|
||||||
Socket.getifaddrs.each do |ifaddr|
|
begin
|
||||||
next unless ifaddr.addr
|
Socket.getifaddrs.each do |ifaddr|
|
||||||
next unless ifaddr.addr.ipv6_linklocal?
|
next unless ifaddr.addr
|
||||||
next if ifaddr.name[0, 2] == "lo"
|
next unless ifaddr.addr.ipv6_linklocal?
|
||||||
r.multicast_interface = ifaddr.ifindex
|
next if ifaddr.name[0, 2] == "lo"
|
||||||
return
|
r.multicast_interface = ifaddr.ifindex
|
||||||
|
return
|
||||||
|
end
|
||||||
|
rescue NotImplementedError
|
||||||
|
# ifindex() function may not be implemented on Windows.
|
||||||
|
return if
|
||||||
|
Socket.ip_address_list.any? { |addrinfo| addrinfo.ipv6? }
|
||||||
end
|
end
|
||||||
skip 'IPv6 not available'
|
skip 'IPv6 not available'
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user