summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Härdeman2025-09-24 13:20:26 +0000
committerÁlvaro Fernández Rojas2025-10-03 10:53:50 +0000
commitd514cb558ef351eaa22667b2dea3ba00cfdf2764 (patch)
tree282dd40784b767e93c9fffaf57bbfc9a3ddd948e
parent2a8dd31261b66638cc79c1b6c1775cb4d2f25e4f (diff)
downloadodhcpd-d514cb558ef351eaa22667b2dea3ba00cfdf2764.tar.gz
dhcpv4: move dhcpv4_fr_stop() up
Thus avoiding another forward declaration. Signed-off-by: David Härdeman <david@hardeman.nu> Link: https://github.com/openwrt/odhcpd/pull/264 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
-rw-r--r--src/dhcpv4.c17
1 files 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)