add support for calls to a hotplug script on interface state changes
[project/netifd.git] / config.c
index cb79b2a..6f8d3b7 100644 (file)
--- a/config.c
+++ b/config.c
@@ -148,8 +148,6 @@ config_parse_interface(struct uci_section *s)
        const char *type;
        struct blob_attr *config;
 
-       D(INTERFACE, "Create interface '%s'\n", s->e.name);
-
        blob_buf_init(&b, 0);
 
        type = uci_lookup_option_string(uci_ctx, s, "type");
@@ -331,6 +329,7 @@ config_init_interfaces(const char *name)
        uci_network = p;
        config_init = true;
 
+       device_reset_config();
        config_init_devices();
 
        uci_foreach_element(&p->sections, e) {
@@ -342,8 +341,10 @@ config_init_interfaces(const char *name)
                if (!strcmp(s->type, "interface"))
                        config_parse_interface(s);
        }
-       device_free_unused(NULL);
        config_init = false;
 
+       device_reset_old();
+       device_init_pending();
+       device_free_unused(NULL);
        interface_start_pending();
 }