Fixes issue interface device config is not applied in some cases.
As the interface device config was applied but not always cached;
an interface device config diff was not always detected.
Simplify device config setting by exposing as api only device_apply_config
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
return;
if (iface->device_config || dev->settings.flags)
- device_set_config(dev, dev->type, b.head);
+ device_apply_config(dev, dev->type, b.head);
return;
error_free_config:
free(config);
}
}
-enum dev_change_type
+static enum dev_change_type
device_set_config(struct device *dev, const struct device_type *type,
struct blob_attr *attr)
{
void device_init_settings(struct device *dev, struct blob_attr **tb);
void device_init_pending(void);
-enum dev_change_type
-device_set_config(struct device *dev, const struct device_type *type,
- struct blob_attr *attr);
enum dev_change_type
device_apply_config(struct device *dev, const struct device_type *type,
struct blob_attr *config);
}
if (add) {
- device_set_present(dev, true);
if (iface->device_config && dev->default_config)
- device_set_config(dev, dev->type, iface->config);
+ device_apply_config(dev, dev->type, iface->config);
+
+ device_set_present(dev, true);
- system_if_apply_settings(dev, &dev->settings, dev->settings.flags);
ret = interface_add_link(iface, dev, link_ext);
} else {
ret = interface_remove_link(iface, dev);
device_init(dev, &tunnel_device_type, name);
tun->set_state = dev->set_state;
dev->set_state = tunnel_set_state;
- device_set_config(dev, &tunnel_device_type, attr);
+ device_apply_config(dev, &tunnel_device_type, attr);
device_set_present(dev, true);
return dev;