Fix ubus reload detection
authorSteven Barth <steven@midlink.org>
Tue, 15 Oct 2013 11:43:45 +0000 (13:43 +0200)
committerSteven Barth <steven@midlink.org>
Tue, 15 Oct 2013 11:43:45 +0000 (13:43 +0200)
src/config.c
src/odhcpd.c
src/odhcpd.h

index 4aaded9..e31740b 100644 (file)
@@ -499,6 +499,10 @@ void odhcpd_run(void)
        signal(SIGHUP, set_stop);
        signal(SIGINT, set_stop);
 
+#ifdef WITH_UBUS
+       init_ubus();
+#endif
+
        do {
                do_reload = uloop_cancelled = false;
 
@@ -558,7 +562,7 @@ void odhcpd_run(void)
 
 
                list_for_each_entry_safe(i, n, &interfaces, head) {
-                       if (i->inuse && !i->ignore) {
+                       if (i->inuse) {
                                // Resolve hybrid mode
                                if (i->dhcpv6 == RELAYD_HYBRID)
                                        i->dhcpv6 = (master && master->dhcpv6 == RELAYD_RELAY) ?
index acedaec..2859907 100644 (file)
@@ -83,9 +83,6 @@ int main()
        if (init_dhcpv4())
                return 4;
 
-       if (init_ubus())
-               return 4;
-
        odhcpd_run();
        return 0;
 }
index fb3db37..531a0ff 100644 (file)
@@ -188,9 +188,12 @@ void odhcpd_hexlify(char *dst, const uint8_t *src, size_t len);
 
 int config_parse_interface(struct blob_attr *b, const char *iname, bool overwrite);
 
+#ifdef WITH_UBUS
+int init_ubus(void);
 const char* ubus_get_ifname(const char *name);
 void ubus_apply_network(void);
 bool ubus_has_prefix(const char *name, const char *ifname);
+#endif
 
 
 // Exported module initializers
@@ -198,7 +201,6 @@ int init_router(void);
 int init_dhcpv6(void);
 int init_dhcpv4(void);
 int init_ndp(void);
-int init_ubus(void);
 
 int setup_router_interface(struct interface *iface, bool enable);
 int setup_dhcpv6_interface(struct interface *iface, bool enable);