From owner-freebsd-stable@FreeBSD.ORG Mon Nov 5 07:31:44 2007 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B844916A41A for ; Mon, 5 Nov 2007 07:31:44 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [IPv6:2001:200:1b1::35]) by mx1.freebsd.org (Postfix) with ESMTP id 555EA13C480 for ; Mon, 5 Nov 2007 07:31:44 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from ncg-dhcp77.isl.rdc.toshiba.co.jp (unknown [IPv6:2001:200:1b1:1010:217:f2ff:fe26:34a0]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id CB99D73018; Mon, 5 Nov 2007 16:31:42 +0900 (JST) Date: Mon, 05 Nov 2007 16:31:33 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: bh@izb.knu.ac.kr In-Reply-To: <1194015907.1422.14.camel@viola.izb.knu.ac.kr> References: <1194015907.1422.14.camel@viola.izb.knu.ac.kr> User-Agent: Wanderlust/2.14.0 (Africa) Emacs/22.0 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: stable@freebsd.org, bind-users@isc.org Subject: Re: [FreeBSD 7.0-BETA1] strange behavior in hostname resolving order X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2007 07:31:44 -0000 At Sat, 03 Nov 2007 00:05:07 +0900, Byung-Hee HWANG wrote: > Usually i prefer 6to4(stf(4)) to 6over4(gif(4)) because some > tunnel providers like to limit bandwidth too musch. So until my > upstream ISP give me native ipv6 addresses (it's take long time maybe), > i'm going to use 6to4 instead of 6over4 continuous. (snip) > And from now on, i would give you one question. Why is 7.0-BETA1 > different from another -RELEASE in hostname resolving order? AFAIK, at > least on 6.2-RELEASE, the order is first IPv6 and then IPv4. However, > 7.0-BETA1 try to lookup in first IPv4 than IPv6. Here is the evidence: This is most likely because 7.0 now installs the address selection policy table at boot time by default: http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/defaults/rc.conf.diff?r1=1.304&r2=1.305 Now if you have (which I guess is your network configuration) A. a global IPv4 address and B. a 6to4 IPv6 address, and have a candidate destination addresses C. a global IPv4 address (like 210.226.20.15) D. a native global IPv6 address (like 2001:218:422:1::15) then getaddrinfo() will prefer the combination of {A and C} because these addresses have a matching scope while B and D don't. If you make sure the 6to4 source address always wins, you should modify the policy table to: Prefix Precedence Label ::1/128 50 0 ::/0 40 1 2002::/16 30 1 ::/96 20 3 ::ffff:0:0/96 100 4 (i.e., change the label of 2002::/16). JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp