From 5b7cfef774fb592164664c5f81bc620c61a9d214 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20H=C3=A4rdeman?= Date: Fri, 17 Oct 2025 13:59:37 +0200 Subject: [PATCH] dhcpv4: define val where it is used in dhcpv4_setup_interface() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/dhcpv4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.30.2