dhcpcd-discuss

Problems with dhcpcd-5.0.7

Ira W. Snyder

Tue Aug 11 15:57:38 2009

Hello all.

I've been using dhcpcd 4.0.12 for a few months, compiled statically,
using a uclibc toolchain. I'm building both for powerpc and i686.

The network where I am using dhcpcd is unfortunately buggy, and has two
DHCP servers. I've tcpdumped the DHCP transaction, and one server sends
an ACK while the other sends a NAK. The NAK comes while dhcpcd is
testing the ip address with ARP. Blacklisting the NAKing server makes
dhcpcd-4.0.12 work, as does using the -A option to disable ARP.

I've read the mailing list archives, and noticed that dhcpcd-5.0.7
should solve this problem by closing the socket listening for DHCP
responses after receiving an ACK. So I decided to upgrade.

I've run into a two bugs in dhcpcd. I'm including my /etc/dhcpcd.conf
file, and then a trace of each bug in action.

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# dhcpcd-run-hooks uses these options.
option domain_name_servers, domain_name, domain_search, host_name

# Most distros have ntp support.
option ntp_servers

# Respect the network MTU
option interface_mtu

# Enable root_path support
option root_path

# A ServerID is required by RFC2131
# Some broken DHCP servers do not send one and dhcpcd can work without it
# Some broken DHCP servers NAK incorrectly and do not include a ServerID
# either so the default is to require a ServerID
require dhcp_server_identifier

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

# It is possible to blacklist a misbehaving DHCP server if necessary
# blacklist 192.168.9.2

===== 1: setting timeout to 0 does not wait indefinitely =====

# dhcpcd -t 0 -p -L eth0
dhcpcd: version 5.0.7 starting
dhcpcd: timed out
# dhcpcd -t 0 -p -L eth0
[   75.170460] PHY: mdio@e0024520:00 - Link is Up - 100/Full
dhcpcd: version 5.0.7 starting
dhcpcd: timed out
# dhcpcd -t 30 -p -L eth0
dhcpcd: version 5.0.7 starting
dhcpcd: eth0: broadcasting for a lease
dhcpcd: eth0: offered 192.168.17.75 from 192.100.16.2
dhcpcd: eth0: acknowledged 192.168.17.75 from 192.100.16.2
dhcpcd: eth0: checking for 192.168.17.75
dhcpcd: eth0: leased 192.168.17.75 for 259200 seconds
dhcpcd: forking to background

Notice that using ``-t 0'', dhcpcd times out immediately. It doesn't
even wait 1 second before exiting. I want dhcpcd to wait forever for a
lease. I worked around this by setting a timeout of 86400 seconds (1
day), which should be long enough.

===== 2: using the -p (persistent) option doesn't work =====

# dhcpcd -t 30 -p -L eth0
dhcpcd: version 5.0.7 starting
dhcpcd: eth0: rebinding lease of 192.168.17.75
dhcpcd: eth0: acknowledged 192.168.17.75 from 192.100.16.2
dhcpcd: eth0: checking for 192.168.17.75
dhcpcd: eth0: leased 192.168.17.75 for 259200 seconds
dhcpcd: forking to background
# ifconfig -a
eth0      Link encap:Ethernet  HWaddr B2:9C:43:B4:D5:7C  
          inet addr:192.168.17.75  Bcast:192.168.17.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:118 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18110 (17.6 KiB)  TX bytes:1500 (1.4 KiB)
          Base address:0x2000 

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# killall dhcpcd
# ifconfig -a
eth0      Link encap:Ethernet  HWaddr B2:9C:43:B4:D5:7C  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:119 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18174 (17.7 KiB)  TX bytes:1542 (1.5 KiB)
          Base address:0x2000 

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


Notice that the IP, broadcast, and netmask have been removed from eth0.
The interface is still "up", but the configuration has been removed.

I've got my root filesystem running on NFS. This means that during
shutdown, I cannot have the network connection drop, or the ``reboot''
command doesn't work properly.

The earlier dhcpcd (4.0.12) was working perfectly in this regard. It
would not de-configure the network interface.

Rather than killall, I have tried using both ``dhcpcd -x eth0'' and
``dhcpcd -k eth0'', both of which have exactly the same effect.

Is there any way I can help to track this down? Enabling debugging (via
the -d option) did not help.

Thanks,
Ira

Follow-Ups:
Re: Problems with dhcpcd-5.0.7Roy Marples
Re: Problems with dhcpcd-5.0.7Ira W. Snyder
Archive administrator: postmaster@marples.name