summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ubus.c')
-rw-r--r--src/ubus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ubus.c b/src/ubus.c
index 55f52dc..9116dd8 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -213,7 +213,6 @@ static int handle_update(_unused struct ubus_context *ctx, _unused struct ubus_o
static void subscribe_netifd(void)
{
- netifd.cb = handle_update;
ubus_subscribe(ubus, &netifd, objid);
ubus_invoke(ubus, objid, "dump", NULL, handle_dump, NULL, 0);
}
@@ -353,6 +352,9 @@ int init_ubus(void)
return -1;
}
+ netifd.cb = handle_update;
+ ubus_register_subscriber(ubus, &netifd);
+
ubus_add_uloop(ubus);
ubus_add_object(ubus, &main_object);
ubus_register_event_handler(ubus, &event_handler, "ubus.object.add");