summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/config.c6
-rw-r--r--src/odhcpd.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index d857f24..3a97e65 100644
--- a/src/config.c
+++ b/src/config.c
@@ -789,7 +789,11 @@ static void lease_delete_assignments(struct lease *l, bool v6)
list_for_each_entry_safe(a, tmp, &l->assignments, lease_list) {
if (a->flags & flag)
+#ifdef DHCPV4_SUPPORT
v6 ? dhcpv6_ia_free_assignment(a) : dhcpv4_free_assignment(a);
+#else
+ dhcpv6_ia_free_assignment(a);
+#endif
}
}
@@ -870,8 +874,10 @@ static void lease_delete(struct lease *l)
list_for_each_entry(a, &l->assignments, lease_list) {
if (a->flags & OAF_DHCPV6)
dhcpv6_ia_free_assignment(a);
+#ifdef DHCPV4_SUPPORT
else if (a->flags & OAF_DHCPV4)
dhcpv4_free_assignment(a);
+#endif
}
free_lease(l);
diff --git a/src/odhcpd.h b/src/odhcpd.h
index 6524e84..e346e97 100644
--- a/src/odhcpd.h
+++ b/src/odhcpd.h
@@ -347,8 +347,6 @@ void ubus_bcast_dhcp_event(const char *type, const uint8_t *mac, const size_t ma
const struct in_addr *addr, const char *name, const char *interface);
#endif
-void dhcpv4_free_assignment(struct dhcp_assignment *a);
-
ssize_t dhcpv6_ia_handle_IAs(uint8_t *buf, size_t buflen, struct interface *iface,
const struct sockaddr_in6 *addr, const void *data, const uint8_t *end);
int dhcpv6_ia_init(void);
@@ -378,6 +376,7 @@ int dhcpv6_init(void);
int ndp_init(void);
#ifdef DHCPV4_SUPPORT
int dhcpv4_init(void);
+void dhcpv4_free_assignment(struct dhcp_assignment *a);
int dhcpv4_setup_interface(struct interface *iface, bool enable);
#endif