Hi,

In message "Re: [ruby-core:19989] [Bug #743] Socket.gethostbyname returns odd values"
    on Wed, 19 Nov 2008 18:58:25 +0900, Alan Johnson <redmine / ruby-lang.org> writes:

|File bug743.patch added
|
|gethostbyname/gethostbyaddr seem to work oddly in many respects.
|
|1) Socket.gethostbyname works differently than TCPSocket.gethostbyname.  The latter doesn't seem to have any real purpose for existing.
|2) The alias array is always empty.
|3) When a host has multiple IP addresses, they are tacked onto the end of the array.  To more faithfully represent a struct hostent, the fourth array member should itself be an array of addresses (matching h_addr_list).
|
|These problems mostly seem to stem from the fact that instead of faithfully calling the underlying library implementation, they ALSO call getaddrinfo.

It's implemented using getaddrinfo because at the time of coding (long
ago) it was virtually only way to support IPv6 addresses.  And you
patch seems destruct IPv6 support.  I'd happy to address above issues,
but we are not going to disable IPv6 support.

							matz.