diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-05-02 17:15:15 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-05-02 17:15:15 +0000 |
commit | 0c83a49ecf4a881dddc5d034277111c4c3d08576 (patch) | |
tree | d80526d94f1d660077edd4a71495c9598e29410d | |
parent | 35635ab27bbeb0a6548dfbca578572f1fcdee55f (diff) |
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ext/socket/socket.c | 9 |
2 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,9 @@ +Wed May 3 02:12:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * ext/socket/socket.c (make_hostent_internal): accept ai_family + check from Sam Roberts <sroberts at uniserve.com>. + [ruby-core:07691] + Mon May 1 12:23:19 2006 <sinara@blade.nagaokaut.ac.jp> * numeric.c (num_div): use floor rather than rb_Integer(). diff --git a/ext/socket/socket.c b/ext/socket/socket.c index aaf6055784..c4e6765456 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; |