dhclient fails to send DHCPRELEASE

Ted Lemon Ted.Lemon at nominum.com
Wed Aug 16 22:29:10 UTC 2006


Ragnar Lönn wrote:
> We thought it might be a race condition, or something similar, with 
> dhclient executing dhclient-script premateurely, causing the interface 
> to be taken down, which destroys the ARP table and causes the following 
> DHCPRELEASE packet to fail to be sent. To test this we disabled the code 
> in dhclient-script that handles DHCPRELEASE . After line 164 of 
> dhclient-script we inserted a line that just exited the script, instead 
> of doing what it normally does upon DHCP release:

That sounds quite plausible.   The DHCPRELEASE is sent through the
regular IP stack, so if you deconfigure the interface before the ARP
reply comes in, the release won't make it out onto the wire.   The
DHCPRELEASE packet has, if I remember correctly, already been sent when
you get into the script, so it should be safe to do something like
putting a one-second delay in there.   A kludge, I grant you, but it
would probably work.

The reason you might not normally see this is that if the DHCP server is
on the other side of a router, the router will almost always be in your
ARP table, so the client won't have to send an ARP to send the
DHCPRELEASE - it'll just send it immediately, using the ARP table entry
for the router.  Whereas if the DHCP server isn't used for other
services, it might not be in the ARP table, necessitating an ARP
transmission and creating enough delay to allow the interface to be
deconfigured before the ARP reply gets back.


More information about the dhcp-users mailing list