diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-03-04 00:45:21 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-03-04 00:45:21 +0100 |
commit | 85c3eb9af8b3d0283f07719a455d503fee7892ae (patch) | |
tree | 75031383eb5be6520f43e31b59c28d9649161439 | |
parent | a8eb0ec5053205dcb7b97e046d25adc1413ab8db (diff) |
device: differentiate between DEV_CONFIG_APPLIED (no device up/down), and DEV_CONFIG_RESTART (device restart)
-rw-r--r-- | device.c | 5 | ||||
-rw-r--r-- | device.h | 1 |
2 files changed, 4 insertions, 2 deletions
@@ -554,7 +554,7 @@ device_reload_config(struct device *dev, struct blob_attr *attr) blob_data(attr), blob_len(attr)); device_init_settings(dev, tb); - return DEV_CONFIG_APPLIED; + return DEV_CONFIG_RESTART; } else return DEV_CONFIG_RECREATE; } @@ -634,11 +634,12 @@ device_create(const char *name, const struct device_type *type, odev->current_config = true; change = device_set_config(odev, type, config); switch (change) { + case DEV_CONFIG_RESTART: case DEV_CONFIG_APPLIED: D(DEVICE, "Device '%s': config applied\n", odev->ifname); free(odev->config); odev->config = config; - if (odev->present) { + if (change == DEV_CONFIG_RESTART && odev->present) { device_set_present(odev, false); device_set_present(odev, true); } @@ -23,6 +23,7 @@ enum { enum dev_change_type { DEV_CONFIG_NO_CHANGE, DEV_CONFIG_APPLIED, + DEV_CONFIG_RESTART, DEV_CONFIG_RECREATE, }; |