summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-14 10:04:35 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-14 10:04:35 +0000
commit24788ea7f6f3ec9d911ac1fce3411a2629f57934 (patch)
tree762f5da440a2026f5dd80d752604b00c1920c9c9 /lib
parentb6d2004e9d573a4d039b0311e1ddad8d66983f7e (diff)
downloadruby-24788ea7f6f3ec9d911ac1fce3411a2629f57934.tar.gz
ruby-24788ea7f6f3ec9d911ac1fce3411a2629f57934.tar.xz
ruby-24788ea7f6f3ec9d911ac1fce3411a2629f57934.zip
* ext/socket/socket.c (Init_socket): IPv6 is not supported although
AF_INET6 is defined on MinGW. * lib/ipaddr.rb (AF_INET6): workaround in the environment which does not support IPv6. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/ipaddr.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb
index b8befe849..79ea0d624 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -32,6 +32,18 @@
require 'socket'
+unless Socket.const_defined? "AF_INET6"
+ class Socket
+ AF_INET6 = Object.new
+ end
+ class << IPSocket
+ alias getaddress_orig getaddress
+ def getaddress(s)
+ /^::/ =~ s ? s : getaddress_orig(s)
+ end
+ end
+end
+
# IPAddr provides a set of methods to manipulate an IP address. Both
# IPv4 and IPv6 are supported.
class IPAddr