sd-dhcp-server: improve predictability of leases
authorTom Gundersen <teg@jklm.no>
Thu, 27 Aug 2015 06:54:41 +0000 (08:54 +0200)
committerTom Gundersen <teg@jklm.no>
Fri, 28 Aug 2015 09:05:32 +0000 (11:05 +0200)
commit83cedf7ae28925e37931e7e92d22be9c936a1def
tree89c615165cb234dc42da2ffe8554ab62e6f3ad92
parent9c92a077b667fe3947cc8a9caa197dea8b80b8e0
sd-dhcp-server: improve predictability of leases

Rather than having all clients attempt to get the same leases (starting at the
beginning of the pool), make each client star at a random offset into the pool
determined by their client id. This greatly increases the chances of a given
client receiving the same IP address even though both the client and server
have lost any lease information (and distinct server instances handing out
the same leases).
src/libsystemd-network/dhcp-server-internal.h
src/libsystemd-network/sd-dhcp-server.c