diff options
| author | Erik Karlsson | 2023-12-05 23:22:58 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2024-01-04 12:35:43 +0000 |
| commit | c18cc79d50002ab8529c21184aceb016c61ac61c (patch) | |
| tree | a27589b2d11a45c2138fcee462bf6d1b19a19c4f | |
| parent | 9cb0cb41830306ea9d78cc1982637d7b74b6700c (diff) | |
| download | netifd-c18cc79d50002ab8529c21184aceb016c61ac61c.tar.gz | |
device: restore cleared flags on device downopenwrt-23.05
In case flags have been cleared because settings failed to apply,
restore them when the device is brought down so that they will be
re-attempted the next time the device is brought up.
Signed-off-by: Erik Karlsson <erik.karlsson@genexis.eu>
| -rw-r--r-- | device.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -172,6 +172,11 @@ static int set_device_state(struct device *dev, bool state) } else { system_if_down(dev); system_if_apply_settings(dev, &dev->orig_settings, dev->orig_settings.flags); + + /* Restore any settings present in UCI which may have + * failed to apply so that they will be re-attempted + * the next time the device is brought up */ + dev->settings.flags |= dev->settings.valid_flags; } return 0; @@ -571,6 +576,9 @@ device_init_settings(struct device *dev, struct blob_attr **tb) s->flags |= DEV_OPT_EEE; } + /* Remember the settings present in UCI */ + s->valid_flags = s->flags; + cur = tb[DEV_ATTR_AUTH_VLAN]; free(dev->config_auth_vlans); dev->config_auth_vlans = cur ? blob_memdup(cur) : NULL; |