From owner-freebsd-current@FreeBSD.ORG Fri Dec 4 22:51:41 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 2F295106568D for ; Fri, 4 Dec 2009 22:51:41 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id C11B88FC17 for ; Fri, 4 Dec 2009 22:51:40 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id nB4MFWPf043851; Fri, 4 Dec 2009 16:15:32 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id nB4MFWbU043850; Fri, 4 Dec 2009 16:15:32 -0600 (CST) (envelope-from brooks) Date: Fri, 4 Dec 2009 16:15:31 -0600 From: Brooks Davis To: Angelo Hongens Message-ID: <20091204221530.GA42198@lor.one-eyed-alien.net> References: <4B195845.4000201@hongens.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline In-Reply-To: <4B195845.4000201@hongens.nl> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Fri, 04 Dec 2009 16:15:33 -0600 (CST) 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: Fri, 04 Dec 2009 22:51:41 -0000 --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > In my /etc/rc.conf: >=20 > ifconfig_em0_name=3D"nic0" > ifconfig_nic0=3D"DHCP" >=20 > 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. >=20 > If I do NOT rename the interface but just config: ifconfig_em0=3D"DHCP" > everything works as well.. >=20 > 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 --J/dobhs11T7y2rNN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLGYoCXY6L6fI4GtQRAs7BAKCmomskrf7KKrvj/7fWeMWPyv8SbwCg4fpI kvrGiYP2JgSv0026/oGkdek= =cpKm -----END PGP SIGNATURE----- --J/dobhs11T7y2rNN--