Date: Mon, 23 Jul 2001 19:38:36 +0100 From: Brian Somers <brian@Awfulhak.org> To: Hajimu UMEMOTO <ume@mahoroba.org> Cc: brian@Awfulhak.org, brian@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, brian@Awfulhak.org Subject: Re: cvs commit: src/lib/libutil realhostname.c Message-ID: <200107231838.f6NIcag68156@hak.lan.Awfulhak.org> In-Reply-To: Message from Hajimu UMEMOTO <ume@mahoroba.org> of "Tue, 24 Jul 2001 03:23:44 %2B0900." <20010724.032344.71142385.ume@mahoroba.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> Hi, > > >>>>> On Mon, 23 Jul 2001 01:40:40 +0100 > >>>>> Brian Somers <brian@Awfulhak.org> said: > > brian> It seems to me that realhostname_sa() already has to deal specially > brian> with ipv4 mapped ipv6 addresses. Surely the correct answer is to > brian> special-case such addresses in the getaddrinfo() hints (see the > brian> attached patch - based on what's in -current at the moment). > > It seems working for IPv4 mapped IPv6 address to me. However, I still > cannot understand why changing AF_UNSPEC to AF_INET6 solves your > problem. If AF_INET6 returns FQDN, I think AF_UNSPEC also returns > FQDN. Using AF_UNSPEC doesn't seem to return any AAAA records at all. > brian> The only alternative that I can think of is to have getaddrinfo() > brian> with a hint of AF_UNSPEC end up finding all A and AAAA records. If > brian> it returns only one type of address, then it can't satisfy both the > brian> ipv4 mapped address case *and* the normal ipv6 case (as per my > brian> fec0::* addresses that I mentioned before). > > It is actually expected behavior of getaddrinfo(). It seems working > so for global, and I could not find special case for site-local in > getaddrinfo(). > > In anyway, existing realhostname_sa() is too complex around handling > IPv4 mapped IPv6 address. I propose to simplify it. Here is a patch > from -current. > > Index: lib/libutil/realhostname.c [patch elided] Yes, this certainly works ok here. I'm happy if you want to commit this :) Thank you. > -- > 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/ -- Brian <brian@freebsd-services.com> <brian@Awfulhak.org> http://www.freebsd-services.com/ <brian@[uk.]FreeBSD.org> Don't _EVER_ lose your sense of humour ! <brian@[uk.]OpenBSD.org> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107231838.f6NIcag68156>