Hi,
>>>>> On Sat, 04 Jan 2003 12:47:29 -0800
>>>>> Terry Lambert <[EMAIL PROTECTED]> said:
tlambert2> The FreeBSD library bug is that the /etc/hosts file entry:
tlambert2> ::1
tlambert2> is not canonized before being compared, for the reverse lookup.
No, it does. I've tested it with following program:
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <netdb.h>
main()
{
struct sockaddr_in6 sin6;
struct hostent *ht;
int error;
char hbuf[NI_MAXHOST];
ht = gethostbyaddr((char *)&in6addr_loopback, sizeof(struct in6_addr),
AF_INET6);
if (!ht)
errx(1, "gethostbyaddr: lookup faild");
printf("gethostbyaddr: %s\n", ht->h_name);
ht = getipnodebyaddr((char *)&in6addr_loopback, sizeof(struct in6_addr),
AF_INET6, &error);
if (!ht)
errx(1, "getipnodebyaddr: lookup faild %d", error);
printf("getipnodebyaddr: %s\n", ht->h_name);
memset(&sin6, 0, sizeof(sin6));
memcpy(&sin6.sin6_addr, &in6addr_loopback, sizeof(struct in6_addr));
sin6.sin6_family = AF_INET6;
sin6.sin6_len = sizeof(sin6);
if (getnameinfo((struct sockaddr *)&sin6, sizeof(sin6),
hbuf, sizeof(hbuf), NULL, 0, 0) != 0)
errx(1, "getnameinfo: lookup faild");
printf("getnameinfo: %s\n", hbuf);
}
Then, it returned as expected:
ume@mille:1082% ./revtest
gethostbyaddr: localhost
getipnodebyaddr: localhost
getnameinfo: localhost
where my /etc/host.conf is:
hosts
#bind
and my /etc/hosts contains:
::1 localhost localhost.mahoroba.org
127.0.0.1 localhost localhost.mahoroba.org
When I commented the ::1 line out in /etc/hosts, the test program
returned:
me@mille:1087% ./revtest
revtest: gethostbyaddr: lookup faild
So, I cannot understand what you say.
tlambert2> It can probably be worked around by spcifying:
tlambert2> 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1
tlambert2> as the left hand side for the IPv6 loopback address, instead of ::1,
tlambert2> in the /etc/hosts file. I don't recommend this, since it would not
tlambert2> encourage the author of the IPv6 resovler code to fix the bug they
tlambert2> introduced.
You don't need to do it at all.
Sincerely,
--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
[EMAIL PROTECTED] [EMAIL PROTECTED] ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message