]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-dhcp-server: fix address availability checks 21175/head
authorToke Høiland-Jørgensen <toke@redhat.com>
Fri, 29 Oct 2021 10:24:33 +0000 (12:24 +0200)
committerToke Høiland-Jørgensen <toke@redhat.com>
Fri, 29 Oct 2021 13:29:05 +0000 (15:29 +0200)
commitcb3c06a02eea17999c4fd577d35be7c9d1745a91
treeb0d8dcd46f1855a231c06fca0315e8f9a87df15f
parentd635a7f9e4c58c5578f4fe2989bb799325067232
sd-dhcp-server: fix address availability checks

The checks for finding a new available address in the pool were broken in two
ways: not using UINT32_TO_PTR() on hashmap lookups resulted in false negatives,
and the check wasn't skipping the server address if that was part of the pool.

Move the check for available addresses to a small helper function and fix both
issues, and also add a check to the REQUEST code for the server address.
src/libsystemd-network/sd-dhcp-server.c