Subject: lib/28667: no description about the case gethostbyname(3) takes an IP address
To: None <,,>
From: Ryo HAYASAKA <>
List: netbsd-bugs
Date: 12/15/2004 13:48:00
>Number:         28667
>Category:       lib
>Synopsis:       no description about the case gethostbyname(3) takes IP address
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 15 13:48:00 +0000 2004
>Originator:     Ryo HAYASAKA
>Release:        NetBSD 2.99.11
Japan Advanced Institute of Science and Technology (JAIST)
System: NetBSD 2.99.11 NetBSD 2.99.11 (BONNIE) #528: Tue Dec 14 06:14:53 JST 2004 i386
Architecture: i386
Machine: i386
The man page of gethostbyname(3) does not contain a description of the
case that gethostbyname takes IPv4 or IPv6 address, not a host name.

Linux (Fedora Core release 2) has the following description:

       The gethostbyname() function returns a structure of type  hostent  for
       the  given  host  name.   Here  name is either a host name, or an IPv4
       address in standard dot notation, or an IPv6  address  in  colon  (and
       possibly  dot)  notation.  (See  RFC  1884 for the description of IPv6
       addresses.)  If name is an IPv4 or IPv6 address,  no  lookup  is  per-
       formed  and  gethostbyname()  simply copies name into the h_name field
       and its struct in_addr equivalent into the h_addr_list[0] field of the
       returned  hostent  structure.
man gethostbyname
Describe it.