From owner-freebsd-current@FreeBSD.ORG Tue May 26 18:47:02 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD6C10656F8; Tue, 26 May 2009 18:47:02 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (unknown [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2B7538FC13; Tue, 26 May 2009 18:47:02 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id n4QIkhVQ075560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 May 2009 03:46:47 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Wed, 27 May 2009 03:46:42 +0900 Message-ID: From: Hajimu UMEMOTO To: Doug Barton In-Reply-To: <4A1C32D8.5010202@FreeBSD.org> References: <7061d9f50905261034l39077a73j1cb0bf7b59b54723@mail.gmail.com> <4A1C32D8.5010202@FreeBSD.org> User-Agent: xcite1.58> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.3 (i386-portbld-freebsd7.2) MULE/5.0 (SAKAKI) X-Operating-System: FreeBSD 7.2-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.2 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Wed, 27 May 2009 03:46:48 +0900 (JST) X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: freebsd-current@FreeBSD.org, Nicolas Blais Subject: Re: dig -6 causes bind9 error X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2009 18:47:02 -0000 Hi, >>>>> On Tue, 26 May 2009 11:20:08 -0700 >>>>> Doug Barton said: dougb> Given that you appear to only have an IPv4 server in your dougb> /etc/resolv.conf file, why would you expect that to work? The -4 and dougb> -6 flags are only relevant when you are using a name server hostname dougb> that has both A and AAAA records. I don't think that `dig -6' should work without an IPv6 server in resolv.conf. dougb> That said, I agree that the error message is less than graceful, dougb> although dig is apparently trying to be helpful in converting what dougb> you've given it into the best IPv6 format it can think of to try and dougb> do what you told it to do. It seems to me that dig(8) tries to use an IPv4-mapped IPv6 address when only IPv4 server is listed in resolv.conf. I confirmed that allowing use of an IPv4-mapped IPv6 address makes dig(8) work against an IPv4 server, with the following patch: Index: contrib/bind9/lib/isc/unix/socket.c diff -u -p contrib/bind9/lib/isc/unix/socket.c.orig contrib/bind9/lib/isc/unix/socket.c --- contrib/bind9/lib/isc/unix/socket.c.orig 2009-01-10 12:00:21.000000000 +0900 +++ contrib/bind9/lib/isc/unix/socket.c 2009-05-27 03:28:13.634476856 +0900 @@ -2108,6 +2108,8 @@ opensocket(isc_socketmgr_t *manager, isc } #endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */ + isc_socket_ipv6only(sock, 0); + return (ISC_R_SUCCESS); } But, I'm skeptical about allowing use of an IPv4-mapped IPv6 address, here. I'm not sure why libisc tries to use an IPv4-mapped IPv6 address in this case. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/