Discussion:
dhcpcd in netbsd-7 and -current
(too old to reply)
John Klos
2015-09-15 17:08:33 UTC
Permalink
Hi,

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.

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.

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.

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. 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.

Thanks,
John

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mike Pumford
2015-09-15 18:31:33 UTC
Permalink
Post by John Klos
Hi,
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.
Only issue I occasionally see with dhclient is that it fails to get an
address on my x64 system with wm adapter. Although I don't believe
that's a dhcpcd bug as dhclient has exactly the same problem so I think
its a quirk of my specifc wm chipset.
Post by John Klos
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.
You might be running into this as its a slightly unusual configuration.
Most people with NetBSD as their NAT router probably have everything set
up statically (I certainly do as my ISP interface is pppoe).
Post by John Klos
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.
Now thats a fair question and possibly something that could be improved.
I've only ever run it in master mode here as that's what makes sense for
my NetBSD dhcp configured systems and in my experience master mode IS
the default.
Post by John Klos
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.
If you add dhcpcd=YES to rc.conf that's what you get. It only runs in
non-master mode if you give it an interface on the command line. If you
want to exclude some interfaces from its processing you can add -Z
<ifname>,<ifname>. You can also list specific interfaces to operate on
(still in master mode) using -z <ifname>,<ifname>.

How are you setting up rc.conf in your system?
Post by John Klos
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.
Launching dhcpcd for the first time on -current (evbmips64-eb) works,
sorta, but spews a non-ending stream of uninterruptible messages to the
trap: pid 892(dhcpcd): sig 11: cause=0x8 epc=0x100173e8 va=0
Well assuming the trap code on mips has decoded the cause register that
looks like something very mips specific went wrong handling a system
call request (although I'm not a netBSD mips expert) so that one looks
like a flaw in the mips kernel or a kernel userland mismatch rather than
a dhcpcd bug. I certainly don't see this on my 2 netbsd 7-rc3 systems
and I've never seen anything in netbsd 6 either.


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Robert Swindells
2015-09-15 18:51:15 UTC
Permalink
Post by John Klos
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.
One suggestion was that dhcpcd is reacting to the behaviour of the
underlying network interfaces, in particular carrier detection, which
interfaces are you using ?
Post by John Klos
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. Launching
dhcpcd for the first time on -current (evbmips64-eb) works, sorta, but
trap: pid 892(dhcpcd): sig 11: cause=0x8 epc=0x100173e8 va=0
[ 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
More missing netbsd32 ioctl() emulation ?



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Roy Marples
2015-09-15 21:57:44 UTC
Permalink
Hi John
Post by John Klos
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.
Post by John Klos
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.
Post by John Klos
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
Post by John Klos
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?
Post by John Klos
Launching
dhcpcd for the first time on -current (evbmips64-eb) works, sorta, but
trap: pid 892(dhcpcd): sig 11: cause=0x8 epc=0x100173e8 va=0
[ 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

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2015-09-16 06:44:52 UTC
Permalink
Post by John Klos
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. Launching
dhcpcd for the first time on -current (evbmips64-eb) works, sorta, but
We may be missing a few netbsd32 fixes in netbsd-7 (some have been pulled
up, but it still is not quite complete even in -current and we do not yet
have regular test runs in this environment due to the pmap issues
described in PR port-evbmips/48564).

Dhcpcd works fine for me on ERLITE with -current as of september 1.

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2015-09-21 18:23:17 UTC
Permalink
Post by Martin Husemann
Dhcpcd works fine for me on ERLITE with -current as of september 1.
I just updated the machine (current, as of earlier today) and it still
works fine.

What problem are you seeing exactly?

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...