From owner-svn-src-user@FreeBSD.ORG Fri Apr 11 23:04:34 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4308FEDF; Fri, 11 Apr 2014 23:04:34 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 55C443D58; Fri, 11 Apr 2014 23:04:33 +0000 (UTC) Message-ID: <534874CD.5080101@FreeBSD.org> Date: Sat, 12 Apr 2014 03:03:41 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r264358 - user/ae/inet6/sys/netinet6 References: <201404112148.s3BLmgC8064206@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 23:04:34 -0000 On 12.04.2014 02:07, Bjoern A. Zeeb wrote: > > On 11 Apr 2014, at 21:48 , Andrey V. Elsukov wrote: > >> Author: ae >> Date: Fri Apr 11 21:48:41 2014 >> New Revision: 264358 >> URL: http://svnweb.freebsd.org/changeset/base/264358 >> >> Log: >> Application can use a global address belonging to the interface other >> than the outgoing. >> >> Found and tested by: bind9 > > > Yeah right and then BCP38 catches is on the router and drops the packet. > This change just sounds wrong. Maybe the application should be improved instead. I just restored the behavior, that all freebsd versions have. The problem was found with bind. It uses sticky socket option to specify source IPv6 address. The node has many interfaces and global IPv6 address is configured on the loopback interface. In this case udp6_output() uses in6_selectsrc() to determine source address. in6_selectsrc() uses source address from socket option. Outgoing interface determined from route lookup. In the end I have added the check for address availability. The original code also has similar check, but it is not so strict as my. Its purpose is to check that address is ready to use. Since the scope zone of global addresses is the whole Internel, the node can send packets via all interfaces. Am I wrong? And this won't work for LLA. -- WBR, Andrey V. Elsukov