From owner-cvs-all Mon Jul 23 11:38:47 2001 Delivered-To: cvs-all@freebsd.org Received: from Awfulhak.org (gw.Awfulhak.org [217.204.245.18]) by hub.freebsd.org (Postfix) with ESMTP id 2F4D537B401; Mon, 23 Jul 2001 11:38:39 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.4/8.11.4) with ESMTP id f6NIcbI06659; Mon, 23 Jul 2001 19:38:37 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.4/8.11.4) with ESMTP id f6NIcag68156; Mon, 23 Jul 2001 19:38:36 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200107231838.f6NIcag68156@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Hajimu UMEMOTO 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 In-Reply-To: Message from Hajimu UMEMOTO of "Tue, 24 Jul 2001 03:23:44 +0900." <20010724.032344.71142385.ume@mahoroba.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 23 Jul 2001 19:38:36 +0100 From: Brian Somers 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 > Hi, > > >>>>> On Mon, 23 Jul 2001 01:40:40 +0100 > >>>>> Brian Somers 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 http://www.freebsd-services.com/ Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message