[systemd-devel] [PATCH 0/4] Add DHCPv4 client restart and Init-Reboot support

Patrik Flykt patrik.flykt at linux.intel.com
Thu Mar 13 04:01:48 PDT 2014


	Hi,

Patches 01/04 and 02/04 are minimal fixes that sat in between the
current head and the changes, both of them are pretty trivial.

Patch 03/04 makes the DHCPv4 client implementation automatically restart
DHCP address negotiations if the previous lease expires. This was
discussed off-list as an improvement we'd like to have in the code as
it frees networkd from making trivial decisions where the intention to
keep the device connected with DHCP is very clear.

Already now the code tries continuosly to get a lease in selecting and
requesting states so the only real addition is the restart after lease
expiry. With this modification, DHCP stops if internal errors < 0 happen,
networkd stops DHCP with sd_dhcp_stop() or the client receives a NAK
from the server. Restarting address acquisition after a NAK leads to a
horrible amount of discover -> offer -> request -> nak exchanges since
receiving a NAK means the server was already successfully contacted but
is not willing to give a lease to the client.

Patch 04/04 rebases the Init-Reboot patch from some time ago, it
unfortunately got lost in the process last time. With this networkd will
be even faster than before should the previous IP address be acceptable
to the server.


Cheers,

	Patrik


Patrik Flykt (4):
  libsystemd-network: Export checksum function to test case
  libsystemd-network: Add hangcheck timer for DHCP client test
  libsystemd-network: Restart DHCP acquisition if the lease expires
  libsystemd-network: Add Init-Reboot support

 src/libsystemd-network/dhcp-internal.h    |   2 +
 src/libsystemd-network/dhcp-packet.c      |  10 +--
 src/libsystemd-network/sd-dhcp-client.c   | 131 +++++++++++++++++++++++-------
 src/libsystemd-network/test-dhcp-client.c |  46 +++++------
 4 files changed, 129 insertions(+), 60 deletions(-)

-- 
1.8.5.2



More information about the systemd-devel mailing list