summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-08 01:13:33 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-08 01:13:33 +0000
commit7eb6e562e51c06e5ef8aad841b5542aebe246f01 (patch)
tree05e897379f1092ba7d8cbfc4f427a1b759a2d19d /ext/socket
parent1926eb045f5992365b65502ea3b12cd5404a132b (diff)
* ext/socket/lib/socket.rb (BasicSocket#connect_address): MacOS X 10.6
returns "::ffff:a.b.c.d" for IPv4-mapped IPv6 address. [ruby-dev:41215] patch by Tomoyuki Chikanaga. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/lib/socket.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 0f26c3e..a568b60 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -192,6 +192,8 @@ class BasicSocket < IO
addr = Addrinfo.new(["AF_INET6", addr.ip_port, nil, "::1"], addr.pfamily, addr.socktype, addr.protocol)
elsif addr.ip_address == "0.0.0.0" # MacOS X 10.4 returns "a.b.c.d" for IPv4-mapped IPv6 address.
addr = Addrinfo.new(["AF_INET6", addr.ip_port, nil, "::1"], addr.pfamily, addr.socktype, addr.protocol)
+ elsif addr.ip_address == "::ffff:0.0.0.0" # MacOS X 10.6 returns "::ffff:a.b.c.d" for IPv4-mapped IPv6 address.
+ addr = Addrinfo.new(["AF_INET6", addr.ip_port, nil, "::1"], addr.pfamily, addr.socktype, addr.protocol)
end
elsif defined?(Socket::AF_UNIX) && afamily == Socket::AF_UNIX
raise SocketError, "unbound Unix socket" if addr.unix_path == ""