diff --git a/ChangeLog b/ChangeLog index c5af272953..c2c631e290 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri May 20 23:23:45 2011 NAKAMURA Usaku + + * ext/socket/socket.c (make_addrinfo): skip IPv6 addresses when ruby + doesn't support IPv6 but system supports it. + [ruby-dev:42944] (#4230) + Fri May 20 23:10:07 2011 NAKAMURA Usaku * win32/README.win32: note to need NT based OS to build ruby. diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 491823ad44..e38d665e6e 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -3218,6 +3218,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));