1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
akr 2010-05-08 01:13:33 +00:00
parent 1926eb045f
commit 7eb6e562e5
2 changed files with 8 additions and 0 deletions

View file

@ -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.

View file

@ -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 == ""