X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=config.c;h=8472d44f0ff9c9dcaa9e4d59699a45921cca8265;hp=5a2e439b9294381a38ad6a7f6579ba26eb7bb433;hb=b8f0ce8319a43d629c8de86df6951892b7e8d813;hpb=ea6dec1329b08109387f091b60a13d1b40839317;ds=sidebyside diff --git a/config.c b/config.c index 5a2e439..8472d44 100644 --- a/config.c +++ b/config.c @@ -176,6 +176,14 @@ config_parse_interface(struct uci_section *s) memcpy(config, b.head, blob_pad_len(b.head)); interface_add(iface, config); + /* + * need to look up the interface name again, in case of config update, + * the pointer will have changed + */ + iface = vlist_find(&interfaces, s->e.name, iface, node); + if (!iface) + return; + dev = iface->main_dev.dev; if (!dev || !dev->default_config) return; @@ -337,7 +345,7 @@ config_init_package(const char *config) uci_unload(ctx, p); } - if (uci_load(ctx, "network", &p)) + if (uci_load(ctx, config, &p)) return NULL; return p;