Re: gethostbyname(3) / IPv6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Laszlo,

On 03/04/2010 01:14 AM, Ersek, Laszlo wrote:
> Hi,
> 
> we were having a discussion in the comp.unix.programmer Usenet newsgroup, 
> starting with Message-ID: 
> <e8e1cb1d-9693-4803-bf29-b4828de384e0@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>. 
> Consequently, I'd like to report two bugs (in separate e-mails):
> 
> (2/2) gethostbyname(3) fails to resolve the IPv6 address "::1", but the 
> manual page says: "If name is an IPv4 or IPv6 address, no lookup is 
> performed and gethostbyname() simply copies name into the h_name field 
> [...]".
> 
> Debian bug report:
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=455762
> 
> glibc bug report:
> 
> http://sourceware.org/bugzilla/show_bug.cgi?id=5479
> 
> SUSv3 link for gethostbyname(3):
> 
> http://www.opengroup.org/onlinepubs/000095399/functions/gethostbyname.html
> 
> It seems that the glibc behavior is conformant, and the manual page is in 
> error.
> 
> I'm using the manpages-dev package, version 3.05-1, under Debian Lenny. 
> However, before sending this report, I've verified the bug's existence in 
> the online page under
> 
> http://www.kernel.org/doc/man-pages/online/pages/man3/gethostbyname.3.html
> 
> If this goes anywhere on linux-man@vger, please keep me CC'd.

Late follow up. That text about Ipv6 addresses has been in the
man page since the beginning, but it appears that the author
didn't test this point. I verified your test. The appropriate
path seems to remove mention of IPv6 from the man page, which I 
have done with the patch below.

Thanks for the report.

Cheers,

Michael

diff --git a/man3/gethostbyname.3 b/man3/gethostbyname.3
index e0b94b0..d79eb32 100644
--- a/man3/gethostbyname.3
+++ b/man3/gethostbyname.3
@@ -149,13 +149,11 @@ for the given host
 .IR name .
 Here
 .I name
-is either a hostname, or an IPv4 address in standard dot notation (as for
-.BR inet_addr (3)),
-or an IPv6 address in colon (and possibly dot) notation.
-(See RFC\ 1884 for the description of IPv6 addresses.)
+is either a hostname or an IPv4 address in standard dot notation (as for
+.BR inet_addr (3)).
 If
 .I name
-is an IPv4 or IPv6 address, no lookup is performed and
+is an IPv4 address, no lookup is performed and
 .BR gethostbyname ()
 simply copies
 .I name



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux