summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-22 08:42:12 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-22 08:42:12 +0000
commitce1ef5b6044027e8042a3685502976d8c057c444 (patch)
tree3508d7b9d95ad6967501f3c62b7a94c3618c9cdb
parent6b7603194da41c578ffb79f937106f39424a97ca (diff)
* ext/socket/ipsocket.c (init_inetsock_internal): drop IPv6 addresses
if INET6 is not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/socket/ipsocket.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ab3ba9..ed76f4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jul 22 17:41:08 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): drop IPv6 addresses
+ if INET6 is not defined.
+
Wed Jul 22 17:29:59 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/socket/extconf.rb: enable ipv6 support for win32.
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index 78c8576..3502580 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -58,6 +58,10 @@ init_inetsock_internal(struct inetsock_arg *arg)
arg->fd = fd = -1;
for (res = arg->remote.res; res; res = res->ai_next) {
+#if !defined(INET6) && defined(AF_INET6)
+ if (res->ai_family == AF_INET6)
+ continue;
+#endif
status = rsock_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
syscall = "socket(2)";
fd = status;