tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dhcpcd in netbsd-7 and -current



Hi John

On Tuesday 15 September 2015 17:08:33 John Klos wrote:
> I'm curious if anyone is working on any of the known issues with dhcpcd.
> I've seen it mentioned in various other places that there are instances
> where dhcpcd doesn't work, but dhclient does. I've come across this
> myself, but not consistently enough to gather much data.

I work on all known dhcpcd issues all the time.
This specific issue you mention is normally the server not responding when a 
DUID based ClientID is used. This is a fault with the server, not dhcpcd.
It's also noted in the stock dhcpcd.conf with rationale for the default 
behaviour.

It should also be noted that Debian and RedHat ship a newer dhclient which I 
believe also does the same and they have bugs raises with the same concerns 
where the consensus seems to be fix the faulty servers.

> Two of the other issues I'm curious about is how to stop a running dhcpcd
> instance without deconfiguring the interface. Sure, the man page says to
> run it with -p or --persistent, but what happens if you have an already
> running dhcpcd which wasn't started with --persistent? While the man page
> weakly implies that the -p option can be used in conjunction with --exit,
> --exit can only be used if dhcpcd was launched in -M (master) mode, which
> isn't common if you're running a machine as a NAT router. I suppose I
> could just kill -9 it, but I'd like something nicer.
> 
> Note that I'm aware that /etc/dhcpcd.conf defaults to persistence. Perhaps
> this should be better framed as asking how one does stuff with dhcpcd when
> not in master mode.

Currently the only way to do this is by forcing the command to go via the 
control socket rather than a signal. So you could do `dhcpcd -xp $(ifconfig -
l)` which should work.

I've improved this in my latest code so that it works without the above hack.

> Oh - /etc/rc.d/dhcpcd does not find a running dhcpcd daemon when it is run
> in non-master mode. I'm thinking I should file a PR, unless someone can
> explain why this is expected behavior. Or master mode should be made the
> default.

Master mode is the default when no interfaces or more than one interface is 
specified on the command line.
If you do file a PR, please include any rc.conf setting for dhcpcd_flags

> Furthermore, it appears that dhcpcd doesn't run as expected on NetBSD-7 or
> current. On NetBSD-7 from two days ago, every third time or so that I send
> dhcpcd a signal (dhcpcd -p --exit, for instance) when it is in master
> mode, it pegs the CPU and fails to quit until a kill -9 is sent.

Is this evbmips64-eb as well?
Can you take a note of the PID when this happens:
# gdb dhcpcd
.....
attach $PID_OF_DHCPCD
bt

and post the backtrace please?

> Launching
> dhcpcd for the first time on -current (evbmips64-eb) works, sorta, but
> spews a non-ending stream of uninterruptible messages to the console:
> 
> trap: pid 892(dhcpcd): sig 11: cause=0x8 epc=0x100173e8 va=0
> registers:
> [ 0]=00000000 [ 1]=ffffffffffffffc0 [ 2]=00000005 [ 3]=00000000
> [ 4]=ffffffffffffffff [ 5]=1c18000000000000 [ 6]=00000000 [ 7]=7fff6930
> [ 8]=00000000 [ 9]=0000005e [10]=00000000 [11]=00000000
> [12]=7fff4e88 [13]=00000007 [14]=00000000 [15]=7878bff0
> [16]=78419290 [17]=7fff6930 [18]=7fff6870 [19]=00000000
> [20]=00000000 [21]=78419a60 [22]=00000000 [23]=10020000
> [24]=7fff68a8 [25]=7871bb80 [26]=00000000 [27]=00000000
> [28]=10060550 [29]=7fff67b8 [30]=78434240 [31]=100172dc
> 
> Even in this state, the client does get and assign an IP, but between all
> the console output and the 100% CPU consumption, something's not happy.

I have an ERLite which is evbmips64-eb. I'll upgrade it to current and try and 
test dhcpcd on it over the next few days. When I first got the router, I'm sure 
I tested dhcpcd and found it working though ..... It's also in production so 
may take a while to find time to test on it.

In the meantime. could you provide a backtrace (you'll need to enable core 
dumps if not already) please?
# gdb dhcpcd
...
core /dhcpcd.core
bt

Roy


Home | Main Index | Thread Index | Old Index