From owner-freebsd-stable@FreeBSD.ORG Wed Jan 9 16:29:05 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 07190121; Wed, 9 Jan 2013 16:29:05 +0000 (UTC) (envelope-from mauzo@anubis.morrow.me.uk) Received: from isis.morrow.me.uk (isis.morrow.me.uk [204.109.63.142]) by mx1.freebsd.org (Postfix) with ESMTP id CCECAB6E; Wed, 9 Jan 2013 16:29:04 +0000 (UTC) Received: from anubis.morrow.me.uk (host109-150-212-220.range109-150.btcentralplus.com [109.150.212.220]) (Authenticated sender: mauzo) by isis.morrow.me.uk (Postfix) with ESMTPSA id 6ED86450DA; Wed, 9 Jan 2013 16:29:03 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.4.1 isis.morrow.me.uk 6ED86450DA DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=morrow.me.uk; s=dkim201101; t=1357748943; bh=gH7O2e5Re8UWH7VVh9u1/ICKcqtL6o/fdzJVyhmFERw=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=spbnn8qn/EWqiPmPKoRLXsneO4eXjxpBbxNhXeKYN8c/KFesIg4PUgvT+r++Ps0aC 7j+VwqR2kUsck2Yl5dXo4GkR1mdvTvS1NpFNGWkF/R4hJNybwu8wzbagPW/pL6trH1 iOkF20IQ+UrayzBKNMD/KB1u2+oYHHiYj0tQK/Iw= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.97.5 at isis.morrow.me.uk Received: by anubis.morrow.me.uk (Postfix, from userid 5001) id 633718C62; Wed, 9 Jan 2013 16:29:00 +0000 (GMT) Date: Wed, 9 Jan 2013 16:29:00 +0000 From: Ben Morrow To: ume@FreeBSD.org, freebsd-stable@freebsd.org Subject: Re: sendmail vs ipv6 broken after upgrade to 9.1 Message-ID: <20130109162900.GA81522@anubis.morrow.me.uk> References: <20130108151837.GF35868@acme.spoerlein.net> <50EC5922.5030600@boland.org> <20130108184051.GI35868@acme.spoerlein.net> <20130109.073354.730245417155474512.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Newsgroups: gmane.os.freebsd.stable Organization: morrow.me.uk User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 16:29:05 -0000 Quoth Hajimu UMEMOTO : > >>>>> On Wed, 09 Jan 2013 23:01:52 +0900 > >>>>> Hajimu UMEMOTO said: > > ume> I changed getipnodebyname to obey ip6addrctl in years past. I read > ume> RFC 2553 again, and realize that it mentions IPv6 addresses are > ume> returned 1st. So, my past change might be bad thing. X-( Where does it say that? All I can find (but I might be being stupid) is the bit in the description of AI_ALL where it says 'A query is first made for AAAA records and if successful, the IPv6 addresses are returned. Another query is then made for A records and any found are returned as IPv4-mapped IPv6 addresses.'. I don't believe that is meant to indicate the AAAA results are returned first in the list, just that both sets of results are included. Also, RFC 6724 (which is more recent), says 'we intend that implementations of APIs such as getaddrinfo() will use the destination address selection algorithm specified here to sort the list of IPv6 and IPv4 addresses that they return.'. AFAICS 'APIs such as getaddrinfo()' is supposed to include getipnodebyname and gethostbyname2, and the whole list of v4 and v6 addresses is supposed to be sorted by those rules. However, given that FreeBSD disables the use of v4-mapped addresses on AF_INET6 sockets by default, it might be sensible to change the rules a little. An application making an AF_INET6 query is probably going to use the result with an AF_INET6 socket, so a v4-mapped address is going to be mostly useless. > I've just committed to disable it: > > http://svnweb.freebsd.org/base?view=revision&revision=245225 I don't think that's the right answer. Even if the code should be changed to always return addresses from A records last, the IPv6 addresses from AAAA records should still be sorted according to ip6addrctl. Otherwise sites with multiple prefixes (say, a ULA prefix and a global prefix) won't be able to control their use properly. Ben