summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-04 00:45:21 +0100
committerFelix Fietkau <nbd@openwrt.org>2012-03-04 00:45:21 +0100
commit85c3eb9af8b3d0283f07719a455d503fee7892ae (patch)
tree75031383eb5be6520f43e31b59c28d9649161439
parenta8eb0ec5053205dcb7b97e046d25adc1413ab8db (diff)
device: differentiate between DEV_CONFIG_APPLIED (no device up/down), and DEV_CONFIG_RESTART (device restart)
-rw-r--r--device.c5
-rw-r--r--device.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/device.c b/device.c
index ab9138b..1d842cf 100644
--- a/device.c
+++ b/device.c
@@ -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);
}
diff --git a/device.h b/device.h
index 2b7fb13..17676b8 100644
--- a/device.h
+++ b/device.h
@@ -23,6 +23,7 @@ enum {
enum dev_change_type {
DEV_CONFIG_NO_CHANGE,
DEV_CONFIG_APPLIED,
+ DEV_CONFIG_RESTART,
DEV_CONFIG_RECREATE,
};