sd-dhcp-server: clear out expired leases when processing requests
authorToke Høiland-Jørgensen <toke@redhat.com>
Thu, 28 Oct 2021 20:36:51 +0000 (22:36 +0200)
committerToke Høiland-Jørgensen <toke@redhat.com>
Fri, 29 Oct 2021 13:29:05 +0000 (15:29 +0200)
commitd635a7f9e4c58c5578f4fe2989bb799325067232
tree20b6163f1e455f6a229407a91684468e7a6f990b
parentff8b7bd6a0d15311889103c49f752b03d4d830a3
sd-dhcp-server: clear out expired leases when processing requests

The DHCP server configuration supports setting a maximum lease time, but old
leases are never actually cleared out if the client doesn't send a RELEASE.
This causes the pool to run out of addresses on networks where clients just
disappear, which is a fairly common occurrence on wireless networks.

Fix this by cleaning up expired leases before processing client requests, so
addresses can be reused for new clients.
src/libsystemd-network/sd-dhcp-server.c