From: Hans Dedecker Date: Mon, 18 Feb 2019 14:35:04 +0000 (+0100) Subject: config: fix build failure in case DHCPv4 support is disabled X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1f01299c677653cf6d67c82c2df7b7e028508876;p=oweals%2Fodhcpd.git config: fix build failure in case DHCPv4 support is disabled Signed-off-by: Hans Dedecker --- 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