Date: Mon, 26 Dec 2011 22:31:44 -0800 From: Garrett Cooper <yanegomi@gmail.com> To: Doug Barton <dougb@FreeBSD.org> Cc: Brooks Davis <brooks@freebsd.org>, freebsd-rc@FreeBSD.ORG, Eygene Ryabinkin <rea@FreeBSD.ORG>, Dag-Erling Smorgrav <des@des.no>, d@delphij.net, Xin LI <delphij@delphij.net> Subject: Re: Annoying ERROR: 'wlan0' is not a DHCP-enabled interface Message-ID: <CDCD86D3-AC1C-4C5F-8848-7BA25CEF63F2@gmail.com> In-Reply-To: <4EF93429.4020404@FreeBSD.org> References: <4EB6693F.2020102@delphij.net> <4EF93429.4020404@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 26, 2011, at 6:57 PM, Doug Barton wrote: > On 11/06/2011 03:02, Xin LI wrote: >> Hi, >>=20 >> It seems that 226879 have introduced an error indication where if an >> interface is up and is not set to DHCP, the devd invoked >> /etc/rc.d/dhclient wlan0 call would generate an annoying message. >>=20 >> I think this message is not necessary at all -- normally >> /etc/rc.d/dhclient is used by the system and it's just legitimate = that >> a network interface comes up and have not assigned as DHCP. >>=20 >> I'd like to propose the attached change, which turns this message = into >> debug message but keep the exit intact. >=20 > The discussion about changing the error message in rc.d/dhclient is > applying the fix to the wrong location. Thanks to Eygene's help in > understanding the history of where the error message came from I have > what I believe to be a better suggestion. >=20 > History: >=20 > Prior to, and after, des' changes in r226345 and r226464 if > rc.d/dhclient was called for a non-DHCP interface it returned with = exit > code 1, but without an error. What des added was an additional test = for > whether or not rc_force is set. This is a feature, because it allows = one > to do 'service dhclient forcestart em0' and have DHCP configuration > attempted even if it's not configured in rc.conf. >=20 > In r226879 rea astutely observed that rc_force is only visible in > certain contexts, and added a better check for that. He also added an > error message that did not previously exist. >=20 > The Problem: >=20 > /etc/rc.d/dhclient is called unconditionally from devd.conf every time > the interface comes up. If the interface is not configured to use = DHCP, > this generates an error in the logs that did not exist prior to = r226879. >=20 > My proposed solution: >=20 > Make devd.conf smarter about how it tries to bring the interface up. > This is accomplished rather easily in the attached patch, which uses > netif instead of dhclient. The virtue of this solution is that it will > use whatever configuration exists for the interface, and will not call > rc.d/dhclient spuriously. >=20 > Brooks added the dhclient invocation to devd.conf in r147088 back in > 2005-06-06. I've cc'ed him to ask if there is any obvious reason why > using netif instead wouldn't be a good idea. The only misgiving that I have about this is that it deletes the = default route and might cause issues with firewalls, natd, more = complicated interface types like laggs, vlans, etc. It annoys me that = torquing the network via rc.d ties FreeBSD into knots still today :(. I'll gladly test this out when I get a chance though sometime = this week. Thanks, -Garrett=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CDCD86D3-AC1C-4C5F-8848-7BA25CEF63F2>