Date: Sun, 05 Jan 2003 07:08:11 +0900 From: Hajimu UMEMOTO <ume@mahoroba.org> To: Terry Lambert <tlambert2@mindspring.com> Cc: Gregory Neil Shapiro <gshapiro@FreeBSD.ORG>, "Gary W. Swearingen" <swear@attbi.com>, freebsd-current@FreeBSD.ORG Subject: Re: [resolution] Re: sendmail (Re: 5.0-RC2 informal PR: 90 sec sendmail delay) Message-ID: <yger8bssh4k.wl%ume@mahoroba.org> In-Reply-To: <3E174861.97A1584C@mindspring.com> References: <rgptrg1uzx.trg@localhost.localdomain> <3E1352BC.4043921B@mindspring.com> <20030101145232.A391@zardoc.esmtp.org> <3E13D095.FC52B758@mindspring.com> <c9622346-1e23-11d7-83f4-0002b32ee8e9@iv.nn.kiev.ua> <ihadihx3fq.dih_-_@localhost.localdomain> <3E163C0A.C0CF8146@mindspring.com> <8p4r8pwgl6.r8p@localhost.localdomain> <15895.766.628111.450121@horsey.gshapiro.net> <3E174861.97A1584C@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
>>>>> On Sat, 04 Jan 2003 12:47:29 -0800
>>>>> Terry Lambert <tlambert2@mindspring.com> 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
ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?yger8bssh4k.wl%ume>
