From owner-freebsd-stable@FreeBSD.ORG Tue Nov 15 22:46:48 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22A4E1065673 for ; Tue, 15 Nov 2011 22:46:48 +0000 (UTC) (envelope-from gr@ubuntu64.secure-side.com) Received: from admin.secure-side.com (admin.secure-side.com [213.251.166.100]) by mx1.freebsd.org (Postfix) with SMTP id 7E2F28FC0C for ; Tue, 15 Nov 2011 22:46:46 +0000 (UTC) Received: (qmail 1109 invoked from network); 15 Nov 2011 22:46:51 -0000 Received: from localhost (HELO ubuntu64.secure-side.com) (@127.0.0.1) by qmail with SMTP; 15 Nov 2011 22:46:51 -0000 Received: from localhost (localhost [127.0.0.1]) by ubuntu64.secure-side.com (Postfix) with ESMTP id 6513E469D9; Tue, 15 Nov 2011 23:35:42 +0100 (CET) Received: from ubuntu64.secure-side.com ([127.0.0.1]) by localhost (ubuntu64.secure-side.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xLr7NCM5+jeH; Tue, 15 Nov 2011 23:35:37 +0100 (CET) Received: from ubuntu64.secure-side.com (ubuntu64.secure-side.com [192.168.1.146]) by ubuntu64.secure-side.com (Postfix) with ESMTP id 9B69D4694D; Tue, 15 Nov 2011 23:35:37 +0100 (CET) Date: Tue, 15 Nov 2011 23:35:37 +0100 (CET) From: GR To: Kristof Provost Message-ID: In-Reply-To: <20111115221453.GO53701@thebe.jupiter.sigsegv.be> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Originating-IP: [82.231.148.242] X-Mailer: Zimbra 7.1.3_GA_3346 (ZimbraWebClient - GC15 ([unknown])/7.1.3_GA_3346) Cc: freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: Re: SIOCGIFADDR broken on 9.0-RC1? 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: Tue, 15 Nov 2011 22:46:48 -0000 >From "Kristof Provost" : [..] > The 'ia' pointer is later used to return the IP address. > > In other words: it returns the first address on the interface > of type IF_INET (which isn't assigned to a jail). > > I think the order of the addresses is not fixed, or rather it depends > on > the order in which you assign addresses. In the handling of > SIOCSIFADDR > new addresses are just appended: > > TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); > > I don't believe this has changed since 8.0. Is it possible something > changed in the network initialisation, leading to the addresses being > assigned in a different order? > > Eagerly awaiting to be told I'm wrong, > Kristof Thanks Kristof. It appears you are right, the order of assignement is important. I configured my interface using DHCP, and added aliases (all in /etc/rc.conf). But on the 8.2-RELEASE, I used static configuration. So, I switched to static assignement and it changes the behaviour (and "fixes" the "bug"). My guess is that during the time waiting for the DHCP offer, all aliases are already configured on the network interface, and the IP address given by DHCP is added at the end of the tail. Is that a wanted behaviour? I find it dangerous (i.e. not exactly what a user is expecting). Note: my aliases are attributed to jails. Regards, -- ^ ___ ___ http://www.GomoR.org/ <-+ | / __ |__/ Senior Security Engineer | | \__/ | \ ---[ zsh$ alias psed='perl -pe ' ]--- | +--> Net::Frame <=> http://search.cpan.org/~gomor/ <---+