From: David Härdeman Date: Fri, 17 Oct 2025 11:59:37 +0000 (+0200) Subject: dhcpv4: define val where it is used in dhcpv4_setup_interface() X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=5b7cfef774fb592164664c5f81bc620c61a9d214;p=project%2Fodhcpd.git dhcpv4: define val where it is used in dhcpv4_setup_interface() This makes it a tiny bit easier to see immediately what "val" is. Signed-off-by: David Härdeman Link: https://github.com/openwrt/odhcpd/pull/318 Signed-off-by: Álvaro Fernández Rojas --- diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 5d49b76..43ee21c 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -1442,7 +1442,7 @@ bool dhcpv4_setup_interface(struct interface *iface, bool enable) .sin_port = htons(DHCPV4_SERVER_PORT), .sin_addr = { INADDR_ANY }, }; - int val = 1; + int val; int fd; if (iface->dhcpv4_event.uloop.fd >= 0) { @@ -1465,7 +1465,7 @@ bool dhcpv4_setup_interface(struct interface *iface, bool enable) goto error; } - /* Basic IPv4 configuration */ + val = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) { error("setsockopt(SO_REUSEADDR): %m"); goto error;