dhcpv4: fix ubus events
authorDavid Härdeman <[email protected]>
Tue, 7 Oct 2025 11:50:47 +0000 (13:50 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Thu, 9 Oct 2025 06:48:57 +0000 (08:48 +0200)
commitdd7a2d474d0d8321f673f335e96a8af75ca894d2
tree5cceb2d33a8ed49537cbf04511449644767ffe9f
parent22481d848e0d37a09c6281a28a59cdfaf8237d62
dhcpv4: fix ubus events

Note that req->ciaddr which was used to generate the broadcast message is
completely under client control and isn't checked, meaning that a
buggy/malicious client could cause broadcast messages containing an arbitrary
IP address.

While addressing this, move the broadcast message generation into
dhcpv4_lease(), so that the function can release the assignment straight away
and return NULL (it seems to return the released assignment just so that it can
be broadcast and later reaped by the expiry timer).

Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/270
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/dhcpv4.c