From 4a7ad73cf73571ffb2a50dd0fed2e8779104e920 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 2 May 2006 17:15:15 +0000 Subject: * ext/socket/socket.c (make_hostent_internal): accept ai_family check from Sam Roberts . [ruby-core:07691] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/socket.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ext') diff --git a/ext/socket/socket.c b/ext/socket/socket.c index aaf605578..c4e676545 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -1252,12 +1252,11 @@ make_hostent_internal(arg) for (ai = addr; ai; ai = ai->ai_next) { /* Pushing all addresses regardless of address family is not the * behaviour expected of gethostbyname(). All the addresses in struct - * hostent->h_addr_list must be of the same family, I think the following - * line would fix this. - - if(ai->ai_family == addr->ai_family) <-- suggested fix + * hostent->h_addr_list must be of the same family. */ - rb_ary_push(ary, (*ipaddr)(ai->ai_addr, ai->ai_addrlen)); + if(ai->ai_family == addr->ai_family) { + rb_ary_push(ary, (*ipaddr)(ai->ai_addr, ai->ai_addrlen)); + } } return ary; -- cgit