From ab6cef402c4f5982fddf72a8633d2a463e8d9006 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 15 Oct 2013 13:43:45 +0200 Subject: [PATCH] Fix ubus reload detection --- src/config.c | 6 +++++- src/odhcpd.c | 3 --- src/odhcpd.h | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index 4aaded9..e31740b 100644 --- a/src/config.c +++ b/src/config.c @@ -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) ? diff --git a/src/odhcpd.c b/src/odhcpd.c index acedaec..2859907 100644 --- a/src/odhcpd.c +++ b/src/odhcpd.c @@ -83,9 +83,6 @@ int main() if (init_dhcpv4()) return 4; - if (init_ubus()) - return 4; - odhcpd_run(); return 0; } diff --git a/src/odhcpd.h b/src/odhcpd.h index fb3db37..531a0ff 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -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); -- 2.25.1