[PATCH] udhcpd: Do not pass out static leases to random clients
Lincoln.Ramsay at digi.com
Thu Dec 3 05:39:11 UTC 2020
Apologies if this arrives twice, I missed that you have to be subscribed to post, I'm assuming my first message went into /dev/null.
I have run into an interesting problem. We have a DHCP server that exists to serve a single address to a single client.
option subnet 255.255.255.252
option router 220.127.116.11
option dns 18.104.22.168
option lease 60
static_lease 11:22:33:44:55:66 192.168.0.2
If machine 11:22:33:44:55:66 sends a DHCPDISCOVER it gets the address as expected.
If a different machine sends a DHCPDISCOVER, the server will not assign it an address because the only available address is attached to a static lease (or alternatively, because that address is already leased out).
However, if a different machine sends a DHCPDISCOVER with DHCP_REQUESTED_IP of 192.168.0.2, the server will happily allow it unless the address is already leased out.
The way we found this was by changing the MAC address in the server's config. We expected the old client to lose its lease but instead, it just kept on getting the address even though the server config indicates it should not.
The patch here will cause the server to ignore the DHCP_REQUESTED_IP in the event that it is a static lease for a different machine. The server will fall back to the available pool of addresses as if the DHCP_REQUESTED_IP was not included.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1172 bytes
More information about the busybox