dhcpv4: simplify dhcpv4_setup_interface()
authorDavid Härdeman <[email protected]>
Thu, 25 Sep 2025 13:45:07 +0000 (15:45 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 7 Oct 2025 09:04:01 +0000 (11:04 +0200)
commit80b881e860e0dece6b34d0ed8fc45ec2d26a2b90
treede31226a2e8db004811a3d657f562e031aeacdb2
parentf26abfdd27c0550ea233c4987c19d50abbc3dcf1
dhcpv4: simplify dhcpv4_setup_interface()

In the disable case, the function would close the interface uloop fd, free
assignments, check if the interface uloop fd should be closed, and return 0.

Simplify the function by bailing early in the disable case, which also removes
one level of indentation for the gist of the function body.

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