Project

General

Profile

Actions

Bug #743

closed

Socket.gethostbyname returns odd values

Added by rogerdpack (Roger Pack) over 16 years ago. Updated about 14 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-core:19845]

Description

=begin
from http://rubyforge.org/tracker/index.php?func=detail&aid=14979&group_id=426&atid=1698

ruby -rsocket -e 'p Socket.gethostbyname("127.0.0.1")'

should return something like ["localhost", [], 2, "\177\000\000\001"]
(it does with ruby 1.8.2 (2005-04-11) and also on windows)

However, on linux with 1.9/1.8.7 it returns

["127.0.0.1", [], 2, "\x7F\x00\x00\x01"]

Socket.gethostbyname("127.0.0.1")'
["127.0.0.1", [], 2, "\177\000\000\001"]

respectively, which I think is unexpected.
Thanks!
from
=end


Files

bug743.patch (7.42 KB) bug743.patch alanwj (Alan Johnson), 11/19/2008 07:02 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0