1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00

sd-dhcp-server: do not offer server address

The server address may be in the pool.
This commit is contained in:
Yu Watanabe 2022-02-17 00:49:21 +09:00
parent 30778ead7a
commit 9e0cb8b61f

View File

@ -797,6 +797,9 @@ static bool address_is_in_pool(sd_dhcp_server *server, be32_t address) {
if (server->pool_size == 0)
return false;
if (address == server->address)
return false;
if (be32toh(address) < (be32toh(server->subnet) | server->pool_offset) ||
be32toh(address) >= (be32toh(server->subnet) | (server->pool_offset + server->pool_size)))
return false;