From 6bc97ee8b15e355abc549e8e1be37b42bcb92425 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 20 May 2011 22:25:41 +0000 Subject: [PATCH] merge revision(s) 30457: * 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 Signed-off-by: URABE, Shyouhei git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@31660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ ext/socket/socket.c | 4 ++++ 2 files changed, 10 insertions(+) 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));