summaryrefslogtreecommitdiff
path: root/test/socket/test_socket.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-10 08:29:33 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-10 08:29:33 +0000
commitba8a74314e475631f5aa3353933d3b7768f30558 (patch)
treee6f6d0e819abc1d3b9b471d325e772da00867b20 /test/socket/test_socket.rb
parent08b3a446e59aad15a30b7ee5246572c8eb7c84a5 (diff)
skip addresses whose interface is set as POINTOPOINT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket/test_socket.rb')
-rw-r--r--test/socket/test_socket.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index f46f4df206..d1f393b5b3 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -305,6 +305,7 @@ class TestSocket < Test::Unit::TestCase
skip "Socket.ip_address_list not implemented"
end
+ ifconfig = nil
Socket.udp_server_sockets(0) {|sockets|
famlies = {}
sockets.each {|s| famlies[s.local_address.afamily] = s }
@@ -327,9 +328,16 @@ class TestSocket < Test::Unit::TestCase
# Link-local IPv6 addresses on those interfaces don't work.
ulSIOCGIFINFO_IN6 = 3225971052
bIFDISABLED = 4
- in6_ifreq = ifr_name
- s.ioctl(ulSIOCGIFINFO_IN6, in6_ifreq)
- next true if in6_ifreq.unpack('A16L6').last[bIFDISABLED-1] == 1
+ in6_ondireq = ifr_name
+ s.ioctl(ulSIOCGIFINFO_IN6, in6_ondireq)
+ next true if in6_ondireq.unpack('A16L6').last[bIFDISABLED-1] == 1
+ end
+ when /darwin/
+ if ai.ipv6?
+ ifconfig ||= `ifconfig`
+ next true if ifconfig.scan(/^(\w+):(.*(?:\n\t.*)*)/).find do|ifname, value|
+ value.include?(ai.ip_address) && value.include?('POINTOPOINT')
+ end
end
end
}