summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 10:09:09 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 10:09:09 +0000
commit5d6121bba475a9267ef8dcbccbfe1a0448a59d36 (patch)
treef1d8d73212d07ef6139d9377ec6f1d9f76f5f95d /ext/socket/socket.c
parent0e218279fab2af1c67026d13c331ef1c8a05824a (diff)
* ext/socket/socket.c (make_addrinfo): skip IPv6 addresses when ruby
doesn't support IPv6 but system supports it. [ruby-dev:42944] (#4230) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index fe3113d517..7187b8fa66 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -3278,6 +3278,10 @@ make_addrinfo(res0)
}
base = rb_ary_new();
for (res = res0; res; res = res->ai_next) {
+#if defined(AF_INET6) && !defined(INET6) /* workaround for Windows */
+ if (res->ai_addr->sa_family == AF_INET6)
+ continue;
+#endif
ary = ipaddr(res->ai_addr);
rb_ary_push(ary, INT2FIX(res->ai_family));
rb_ary_push(ary, INT2FIX(res->ai_socktype));