From owner-cvs-all Sun Jul 22 13:53: 6 2001 Delivered-To: cvs-all@freebsd.org Received: from light.imasy.or.jp (light.imasy.or.jp [202.227.24.4]) by hub.freebsd.org (Postfix) with ESMTP id 077BD37B405; Sun, 22 Jul 2001 13:52:54 -0700 (PDT) (envelope-from ume@mahoroba.org) Received: (from uucp@localhost) by light.imasy.or.jp (8.11.3+3.4W/8.11.3/light) with UUCP id f6MKqke18057; Mon, 23 Jul 2001 05:52:46 +0900 (JST) (envelope-from ume@mahoroba.org) Received: from peace.mahoroba.org (IDENT:zjp3nep+CKA7FYPefu+Lw8I9+rQ3c+aoS44JqVHNXBgdmOvICrbjCA9tkkT7gZqg@peace.mahoroba.org [3ffe:505:2:0:200:f8ff:fe05:3eae]) (authenticated as ume with CRAM-MD5) by mail.mahoroba.org (8.11.4/8.11.4/chaos) with ESMTP/inet6 id f6MKqPL28696; Mon, 23 Jul 2001 05:52:25 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 23 Jul 2001 05:52:25 +0900 (JST) Message-Id: <20010723.055225.111155784.ume@mahoroba.org> To: brian@Awfulhak.org Cc: brian@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libutil realhostname.c From: Hajimu UMEMOTO In-Reply-To: <200107222011.f6MKBog08546@hak.lan.Awfulhak.org> References: <200107222011.f6MKBog08546@hak.lan.Awfulhak.org> X-Mailer: xcite1.38> Mew version 1.95b119 on Emacs 20.7 / Mule 4.0 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?= X-PGP-Public-Key: http://www.imasy.org/~ume/publickey.asc X-PGP-Fingerprint: 6B 0C 53 FC 5D D0 37 91 05 D0 B3 EF 36 9B 6A BC X-URL: http://www.imasy.org/~ume/ X-Operating-System: FreeBSD 5.0-CURRENT Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >>>>> On Sun, 22 Jul 2001 21:11:50 +0100 >>>>> Brian Somers said: brian> With this patch, getaddrinfo() only comes back with the A record, and Yes, it is expected behavior. brian> realhostname_sa() fails (because it's not the same as the connecting brian> IPv6 number). Umm, realhostname_sa() has a trick for this case. The past when I tested it, it seemd working to me. #ifdef INET6 /* * XXX IPv4 mapped IPv6 addr consideraton, * specified in rfc2373. */ if (sa->sa_family == AF_INET && addr->sa_family == AF_INET6) { struct in_addr *in; struct in6_addr *in6; in = &((struct sockaddr_in *)sa)->sin_addr; in6 = &((struct sockaddr_in6 *)addr)->sin6_addr; if (IN6_IS_ADDR_V4MAPPED(in6) && !memcmp(&in6->s6_addr[12], in, sizeof(*in))) { result = HOSTNAME_FOUND; if (ores->ai_canonname == 0 || strlen(ores->ai_canonname) > hsize) { freeaddrinfo(ores); goto numeric; } strncpy(host, ores->ai_canonname, hsize); break; } } #endif brian> I'd try to be of more help, but I'm still confused about the brian> intention of the getaddrinfo() hints. For the ::ffff:w.x.y.z brian> addresses, surely looking that up and getting whatever w.x.y.z's PTR brian> record refers to, then trying to get an A record back from that will brian> just end up with ``w.x.y.z'' -- which won't match the original IP and brian> will just make things fail. When hostname is specified to getaddrinfo(3), getaddrinfo(3) doesn't concern about mapped address. So, AF_INET is returned. brian> I'm assuming the following DNS setup now: brian> $ORIGIN y.x.w.in-addr.any. brian> z IN PTR some.domain.name. brian> $ORIGIN domain.name. brian> some IN A w.x.y.z It seems fine to me. brian> If you could give me a better idea about what's supposed to happen brian> (or point me at an RFC or something) it'd be appreciated. Sorry to brian> be such a PITA :-/ Please refer RFC2373 and RFC2553. -- 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 cvs-all" in the body of the message