Revert "vlan: reset device state on init"
[project/netifd.git] / config.c
index 8b6a5ba..4e91e18 100644 (file)
--- a/config.c
+++ b/config.c
@@ -105,7 +105,7 @@ config_parse_interface(struct uci_section *s, bool alias)
        if (iface->proto_handler && iface->proto_handler->config_params)
                uci_to_blob(&b, s, iface->proto_handler->config_params);
 
-       if (!bridge && uci_to_blob(&b, s, simple_device_type.config_params))
+       if (!bridge && uci_to_blob(&b, s, simple_device_type.config_params) > 1)
                iface->device_config = true;
 
        config = blob_memdup(b.head);
@@ -136,7 +136,8 @@ config_parse_interface(struct uci_section *s, bool alias)
        if (blob_len(b.head) == 0)
                return;
 
-       device_set_config(dev, dev->type, b.head);
+       if (iface->device_config && dev->default_config)
+               device_set_config(dev, dev->type, b.head);
        return;
 error_free_config:
        free(config);
@@ -217,7 +218,7 @@ config_init_devices(void)
                        if (!dev)
                                continue;
 
-                       device_apply_config(dev, dev->type, blob_memdup(b.head));
+                       device_apply_config(dev, dev->type, b.head);
                }
                dev->default_config = false;
        }