summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/socket/lib/socket.rb2
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fd7376e..f59c13f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat May 8 10:03:39 2010 Tanaka Akira <akr@fsij.org>
+
+ * 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.
+
Fri May 7 23:51:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* version.h: bump up to 1.9.3.
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 == ""