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 4aaded9f342e1b72c440956987bf6c4d6e8a8c35..e31740bdd7ee28aeae21f94e07d2d078152123a9 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 acedaec0b13cf26cef5dc72cfd5bf4ed56506ab9..285990760dd89e80e495fe7ab58d3320cbe4add6 100644 (file)
@@ -83,9 +83,6 @@ int main()
        if (init_dhcpv4())
                return 4;
 
-       if (init_ubus())
-               return 4;
-
        odhcpd_run();
        return 0;
 }
index fb3db37f80650a4c575a0cb5a2d8742f56033263..531a0ff155767f91348638ba043a038c36e9a43c 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);