From ba8a74314e475631f5aa3353933d3b7768f30558 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 10 May 2012 08:29:33 +0000 Subject: 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 --- test/socket/test_socket.rb | 14 +++++++++++--- 1 file 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 } -- cgit v1.2.3