From owner-freebsd-current@FreeBSD.ORG Sat Dec 5 07:27:01 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 7BAAE1065672; Sat, 5 Dec 2009 07:27:01 +0000 (UTC) (envelope-from angelo@hongens.nl) Received: from hon-mta-01.hongens.local (unknown [IPv6:2001:610:6a8::9]) by mx1.freebsd.org (Postfix) with ESMTP id 2AE628FC1C; Sat, 5 Dec 2009 07:27:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hon-mta-01.hongens.local (Postfix) with ESMTP id 5E47CD9; Sat, 5 Dec 2009 08:26:59 +0100 (CET) X-Virus-Scanned: amavisd-new at hongens.nl Received: from hon-mta-01.hongens.local ([127.0.0.1]) by localhost (hon-mta-01.hongens.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eiqfVz23gac6; Sat, 5 Dec 2009 08:26:51 +0100 (CET) Received: from angelomobiel.local (unknown [192.168.127.96]) by hon-mta-01.hongens.local (Postfix) with ESMTPA id BB8F15C; Sat, 5 Dec 2009 08:26:51 +0100 (CET) Message-ID: <4B1A0B39.5060201@hongens.nl> Date: Sat, 05 Dec 2009 08:26:49 +0100 From: Angelo Hongens User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Brooks Davis References: <4B195845.4000201@hongens.nl> <20091204221530.GA42198@lor.one-eyed-alien.net> In-Reply-To: <20091204221530.GA42198@lor.one-eyed-alien.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: "freebsd-current@freebsd.org" Subject: Re: FreeBSD 8.0 problems with interface renaming and dhcp? 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: Sat, 05 Dec 2009 07:27:01 -0000 On 04-12-2009 23:15, Brooks Davis wrote: > On Fri, Dec 04, 2009 at 07:43:17PM +0100, Angelo Hongens wrote: >> On most of my BSD machines I rename the interfaces to nic0. This way, I >> can swap cards and drivers, and keep the rest of my config the same. >> >> I upgraded one of these machines from 7.2 to 8.0 (both standard kernel), >> and suddenly the machine would not get a dhcp lease. >> >> In my /etc/rc.conf: >> >> ifconfig_em0_name="nic0" >> ifconfig_nic0="DHCP" >> >> The machine woud boot, but not get an ip. (and no dhclient output while >> booting). And ifconfig would show the nic nic0 up, but without an ip. If >> I do 'dhclient nic0' it immediately gets an ip, and all is well. >> >> If I do NOT rename the interface but just config: ifconfig_em0="DHCP" >> everything works as well.. >> >> So is this a new bug or feature introduced in FreeBSD8? Is it something >> that can be fixed? (So dhclient is executed for renamed interfaces.) > > I think the problem here is that with the new DHCP configuration where > we only start DHCP based on link events we're loosing a race between the > link coming up and the rename occurring. The absolutely correct answer is > that the nic should no be trying to do anything until it is configured > up and I don't think that happens before the rename (it shouldn't). > It's likely the case though that a number of nics incorrectly start doing > things before they are configured and thus racing the rename. The > easiest workaround in the rc.d code would probably be to add some code > to the rename section to take the interface down and then bring it back > up after the rename. That should cause it to renegotiate and generate > an event. > > The no code change workaround is to change DHCP to SYNCDHCP which will > restore the old behavior on this interface. > > -- Brooks Great, configuring SYNCDHCP does exactly what it should do. I'm happy. If I understand you correctly, the long term solution would be to fix the 'em' driver so that it never does anything with an interface until it's configured (in my case: renamed). I never even touched C code, so I hope someone else will look into that ;) -- Met vriendelijke groet, Angelo Höngens