On Wed, 8 Apr 2015 20:47:56 -0700 Kevin Oberman <rkober...@gmail.com> wrote:
>
The
> idea is that a system should attempt to maintain the same address, if
> possible. That is why the dhclient.leases files are there. Even if a system
> has its interface shut down or is rebooted, the file contains the last
> assigned address. If it issues a request and the network is different, it
> will not get the address. If it is on the same network, it will get it's
> old address.
> 
> >From the RFC 4.3.2 DHCPREQUEST message:
> 'requested IP address' option MUST be filled in with client's notion of its
> previously assigned address.
> 

The data from the leases file is used to fill in the requested IP
address in the message body.  The source address of the packet should
be set to 0.

The fix appears to be pretty trivial:

Index: sbin/dhclient/dhclient.c
===================================================================
--- sbin/dhclient/dhclient.c    (revision 280783)
+++ sbin/dhclient/dhclient.c    (working copy)
@@ -1460,7 +1460,8 @@
                memcpy(&to.s_addr, ip->client->destination.iabuf,
                    sizeof(to.s_addr));
 
-       if (ip->client->state != S_REQUESTING)
+       if (ip->client->state != S_REQUESTING &&
+           ip->client->state != S_REBOOTING)
                memcpy(&from, ip->client->active->address.iabuf,
                    sizeof(from));
        else

Attachment: pgpgYPLO1Iclb.pgp
Description: OpenPGP digital signature

Reply via email to