chiark / gitweb /
sd-dhcp-client: fix REBOOT state handling
authorDan Williams <dcbw@redhat.com>
Tue, 4 Nov 2014 17:20:43 +0000 (11:20 -0600)
committerTom Gundersen <teg@jklm.no>
Tue, 18 Nov 2014 17:25:43 +0000 (18:25 +0100)
commitd8d74ef06fa0ccf39084a6177e70e4c2297cca57
tree4b76a54f0c2db48bf5aadbd56085621744fc47ce
parentb77acbcf7d9070ac01333a1b98c6222bee599550
sd-dhcp-client: fix REBOOT state handling

client->secs wasn't getting set in the REBOOT state, causing
an assertion.  REBOOT should work the same way as INIT, per
RFC 2131:

 secs   2  Filled in by client, seconds elapsed since client
           began address acquisition or renewal process.

REBOOT is necessary because some DHCP servers (eg on
home routers) do not hand back the same IP address unless the
'ciaddr' field is filled with that address, which DISCOVER
cannot do per the RFCs.  This leads to multiple leases
on machine reboot or DHCP client restart.
src/libsystemd-network/sd-dhcp-client.c