Revert "dhcpv4: make dhcpv4 support optional"
authorHans Dedecker <dedeckeh@gmail.com>
Fri, 2 Mar 2018 15:25:13 +0000 (16:25 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Fri, 2 Mar 2018 15:25:13 +0000 (16:25 +0100)
This reverts commit 53f52e3ea1d941941f0baf317816d2c25135161e.

CMakeLists.txt
src/config.c
src/odhcpd.c
src/odhcpd.h

index e2514c653cdbe8177534b612ac5284a9e0edddff..0855458489c5a687c716e220e3f428f3907ea268 100644 (file)
@@ -25,12 +25,7 @@ if(${UBUS})
        set(EXT_LINK ${EXT_LINK} ubus)
 endif(${UBUS})
 
-if (${DHCPV4_SUPPORT})
-       add_definitions(-DDHCPV4_SUPPORT)
-       set(EXT_SRC ${EXT_SRC} src/dhcpv4.c)
-endif(${DHCPV4})
-
-add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/dhcpv6-ia.c ${EXT_SRC})
+add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/dhcpv6-ia.c src/dhcpv4.c ${EXT_SRC})
 target_link_libraries(odhcpd resolv ubox uci ${libnl} ${EXT_LINK})
 
 # Installation
index 753ac7336e8268985f2ec741e34c728398b93049..858362ac3eb85c9c90890ba65d8b3859a194c91a 100644 (file)
@@ -227,9 +227,7 @@ static void close_interface(struct interface *iface)
        setup_router_interface(iface, false);
        setup_dhcpv6_interface(iface, false);
        setup_ndp_interface(iface, false);
-#ifdef DHCPV4_SUPPORT
        setup_dhcpv4_interface(iface, false);
-#endif
 
        clean_interface(iface);
        free(iface);
@@ -775,9 +773,7 @@ void odhcpd_reload(void)
                        setup_router_interface(i, !i->ignore || i->ra != RELAYD_DISABLED);
                        setup_dhcpv6_interface(i, !i->ignore || i->dhcpv6 != RELAYD_DISABLED);
                        setup_ndp_interface(i, !i->ignore || i->ndp != RELAYD_DISABLED);
-#ifdef DHCPV4_SUPPORT
                        setup_dhcpv4_interface(i, !i->ignore || i->dhcpv4 != RELAYD_DISABLED);
-#endif
                } else
                        close_interface(i);
        }
index b1cae34cddc46f1f458f6681c2555bc250041bc9..8a1c66e6721a37c83af600ba8b29ef401744e29b 100644 (file)
@@ -116,10 +116,8 @@ int main(int argc, char **argv)
        if (init_ndp())
                return 4;
 
-#ifdef DHCPV4_SUPPORT
        if (init_dhcpv4())
                return 4;
-#endif
 
        odhcpd_run();
        return 0;
index 258d3b6d48d30dec765daac06d4115f1bfc4bded..98bc5658950b3b6d21dea1483e9afab28d1cb572 100644 (file)
@@ -244,16 +244,12 @@ bool ubus_has_prefix(const char *name, const char *ifname);
 // Exported module initializers
 int init_router(void);
 int init_dhcpv6(void);
-#ifdef DHCPV4_SUPPORT
 int init_dhcpv4(void);
-#endif
 int init_ndp(void);
 
 int setup_router_interface(struct interface *iface, bool enable);
 int setup_dhcpv6_interface(struct interface *iface, bool enable);
 int setup_ndp_interface(struct interface *iface, bool enable);
-#ifdef DHCPV4_SUPPORT
 int setup_dhcpv4_interface(struct interface *iface, bool enable);
-#endif
 
 void odhcpd_reload(void);