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.

(cherry picked from commit 9e0cb8b61f)
This commit is contained in:
Yu Watanabe 2022-02-17 00:49:21 +09:00 committed by Luca Boccassi
parent 995086918c
commit 336711e062

View File

@ -752,6 +752,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;