From bd1a3eb65b9e308028c18e1ed7ffde474a3b1244 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 28 Jan 2022 02:25:37 +0900 Subject: [PATCH] sd-dhcp-server: do not assign address reserved for static leases to non-matching clients This fix the root cause of the issue #22253. --- src/libsystemd-network/sd-dhcp-server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index 2f429020bb..904298ebb0 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -801,6 +801,9 @@ static bool address_is_in_pool(sd_dhcp_server *server, be32_t address) { be32toh(address) >= (be32toh(server->subnet) | (server->pool_offset + server->pool_size))) return false; + if (hashmap_contains(server->static_leases_by_address, UINT32_TO_PTR(address))) + return false; + return true; }