const char *ifname = NULL;
#ifdef WITH_UBUS
- if (overwrite)
+ if (overwrite || !iface->ifname[0])
ifname = ubus_get_ifname(name);
#endif
if ((c = tb[IFACE_ATTR_IFNAME]))
static void subscribe_netifd(void)
{
- netifd.cb = handle_update;
ubus_subscribe(ubus, &netifd, objid);
ubus_invoke(ubus, objid, "dump", NULL, handle_dump, NULL, 0);
}
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");