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): returns ::1
if the address is IPv4-mapped IPv6 address for 0.0.0.0 for MacOS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2f83f7a7f4
commit
54cd7ea168
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Feb 28 14:50:47 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/lib/socket.rb (BasicSocket#connect_address): returns ::1
|
||||
if the address is IPv4-mapped IPv6 address for 0.0.0.0 for MacOS X.
|
||||
|
||||
Sat Feb 28 00:18:40 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/raddrinfo.c: suppress strict-aliasing warning with
|
||||
|
|
|
@ -190,6 +190,8 @@ class BasicSocket
|
|||
raise SocketError, "unbound IPv6 socket" if addr.ip_port == 0
|
||||
if addr.ip_address == "::"
|
||||
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)
|
||||
end
|
||||
elsif defined?(Socket::AF_UNIX) && afamily == Socket::AF_UNIX
|
||||
raise SocketError, "unbound Unix socket" if addr.unix_path == ""
|
||||
|
|
Loading…
Add table
Reference in a new issue