X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=ubus.c;h=02becf22c8a37b894fba22aad87488f64c036845;hp=aeb864fdabd24610c2f5a8c18351147c1fc1b69d;hb=4b7662c5841214c105a174fdc9ab9fac870abab9;hpb=ede9739fe90f5da09f14481d10a4f11c000072de diff --git a/ubus.c b/ubus.c index aeb864f..02becf2 100644 --- a/ubus.c +++ b/ubus.c @@ -147,13 +147,16 @@ netifd_add_dynamic(struct ubus_context *ctx, struct ubus_object *obj, goto error; interface_add(iface, config); - interface_set_dynamic(iface); - // need to look up the interface name again, in case of config update, + // need to look up the interface name again, in case of config update + // the pointer will have changed iface = vlist_find(&interfaces, name, iface, node); if (!iface) return UBUS_STATUS_UNKNOWN_ERROR; + // Set interface as dynamic + interface_set_dynamic(iface); + dev = iface->main_dev.dev; if (!dev || !dev->default_config) return UBUS_STATUS_UNKNOWN_ERROR;