From d514cb558ef351eaa22667b2dea3ba00cfdf2764 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20H=C3=A4rdeman?= Date: Wed, 24 Sep 2025 15:20:26 +0200 Subject: [PATCH] dhcpv4: move dhcpv4_fr_stop() up MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Thus avoiding another forward declaration. Signed-off-by: David Härdeman Link: https://github.com/openwrt/odhcpd/pull/264 Signed-off-by: Álvaro Fernández Rojas --- src/dhcpv4.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 01da373..f7d93c4 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -42,7 +42,6 @@ static bool addr_is_fr_ip(struct interface *iface, struct in_addr *addr); static void dhcpv4_fr_rand_delay(struct dhcp_assignment *a); -static void dhcpv4_fr_stop(struct dhcp_assignment *a); static struct dhcp_assignment* dhcpv4_lease(struct interface *iface, enum dhcpv4_msg msg, const uint8_t *mac, const uint32_t reqaddr, uint32_t *leasetime, const char *hostname, const size_t hostname_len, @@ -259,6 +258,14 @@ static void dhcpv4_fr_send(struct dhcp_assignment *a) odhcpd_print_mac(a->hwaddr, sizeof(a->hwaddr)), inet_ntoa(dest.sin_addr)); } +static void dhcpv4_fr_stop(struct dhcp_assignment *a) +{ + uloop_timeout_cancel(&a->fr_timer); + decr_ref_cnt_ip(&a->fr_ip, a->iface); + a->fr_cnt = 0; + a->fr_timer.cb = NULL; +} + static void dhcpv4_fr_timer(struct uloop_timeout *event) { struct dhcp_assignment *a = container_of(event, struct dhcp_assignment, fr_timer); @@ -302,14 +309,6 @@ static void dhcpv4_fr_rand_delay(struct dhcp_assignment *a) a->fr_timer.cb = dhcpv4_fr_delay_timer; } -static void dhcpv4_fr_stop(struct dhcp_assignment *a) -{ - uloop_timeout_cancel(&a->fr_timer); - decr_ref_cnt_ip(&a->fr_ip, a->iface); - a->fr_cnt = 0; - a->fr_timer.cb = NULL; -} - static int dhcpv4_send_reply(const void *buf, size_t len, const struct sockaddr *dest, socklen_t dest_len, void *opaque) -- 2.30.2