Annoying ERROR: 'wlan0' is not a DHCP-enabled interface

Doug Barton dougb at FreeBSD.org
Tue Dec 27 03:17:42 UTC 2011


On 12/26/2011 01:52, Eygene Ryabinkin wrote:
> Mon, Dec 26, 2011 at 01:11:53AM -0800, Doug Barton wrote:
>> On 12/26/2011 01:02, Garrett Cooper wrote:
>>> $ svn log -r 226879 
>>> ------------------------------------------------------------------------
>>>
>>>
>> r226879 | rea | 2011-10-27 23:03:38 -0700 (Thu, 27 Oct 2011) | 10 lines
>>>
>>> Fix handling of rc_force in /etc/rc.d/dhclient
>>>
>>> Variable 'rc_force' is accessible only at the time of
>>> rc_run_command, so it can't be examined from the script's main code.
>>>
>>> Spotted by:	hrs Reviewed by:	hrs, des Approved by:	des MFC after:	2
>>> weeks 
>>> ------------------------------------------------------------------------
>>>
>>>  It simply didn't exist before this change; before it was just a
>>> 'return 1', which is illegal outside of functions, amongst other
>>> things.
>>
>> Ok, so I think here is some of the source of the confusion:
> 
> Unlikely that the confusion will come from my side:

I didn't say *you* were confused about this, I said "the confusion." :)

> The whole story is the following one.

Thanks for your background information. I dug through the svn logs and
you are of course correct that the error message didn't exist prior to
your change. However I think the error message is still valuable because
it will catch problems such as: ifconfig_em0='DHPC'

I just sent a response to delphij's original message with what I think
is a better solution, attempt to more properly configure the interface
from devd.conf in the first place. This avoids spuriously calling
rc.d/dhclient.

>>> So I vote to just remove the message (convert the err 1 to a exit 1)
>>
>> I haven't dug into it yet, but if it was a return previously it almost
>> certainly should not be an exit now.
> 
> Doug, I may be blunt now, but how can one ever say something about the
> code that he hasn't digged into?  I know about the common sense, but
> it alone can't be applied to the non-trivial problems with any hope
> for good results.

Please note that I qualified my statement, precisely because I had not
yet dug deeply into it.

However, to answer your question "how can one ever say something about
the code that he hasn't digged into?":

1. Years of experience
2. Depth of understanding of the rc.d code generally
3. A finely honed filter which detects "This smells like fixing a
symptom rather than fixing the actual problem."

In the end it seems that I was right, dhclient was the wrong place to
address this issue. I even suggested that the proper place to fix it was
in devd.conf. Now you can say that I just got lucky, but I would beg to
differ. :)


Doug

-- 

		[^L]

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/



More information about the freebsd-rc mailing list