config: fix build failure in case DHCPv4 support is disabled
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 18 Feb 2019 14:35:04 +0000 (15:35 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 18 Feb 2019 15:02:03 +0000 (16:02 +0100)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/config.c
src/odhcpd.h

index d857f24b53c73a657526fa6a71aa05e88b5ef93e..3a97e6598e4c625bba9b047b63ef6d5aec1afc09 100644 (file)
@@ -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);
index 6524e84a694e02bcd4ae81d81f3ac831b54b9e86..e346e97e19481e82d68d944b5db7ecdcc355e999 100644 (file)
@@ -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