diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2014-12-04 12:07:15 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-12-08 18:13:45 +0100 |
commit | 9d8dd091f8f336b111364ed211165b5ec9842a24 (patch) | |
tree | 567262300d2e9d6e4e98c9a285c8099bfcdcfd6a | |
parent | 25289c946427db676d41c0fa4e6c01ade2f43b66 (diff) |
netifd: Fix restore of original device settings
Don't restore original device settings based on the device settings flags in system_if_down
as device flags are already reset when the device config is deleted.
Therefore move the masking of the relevant original device settings to system_if_up.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r-- | system-linux.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/system-linux.c b/system-linux.c index ed69bef..4662bf8 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1033,6 +1033,8 @@ system_if_apply_settings(struct device *dev, struct device_settings *s, unsigned int system_if_up(struct device *dev) { system_if_get_settings(dev, &dev->orig_settings); + /* Only keep orig settings based on what needs to be set */ + dev->orig_settings.flags &= dev->settings.flags; system_if_apply_settings(dev, &dev->settings, dev->settings.flags); return system_if_flags(dev->ifname, IFF_UP, 0); } @@ -1040,7 +1042,6 @@ int system_if_up(struct device *dev) int system_if_down(struct device *dev) { int ret = system_if_flags(dev->ifname, 0, IFF_UP); - dev->orig_settings.flags &= dev->settings.flags; system_if_apply_settings(dev, &dev->orig_settings, dev->orig_settings.flags); return ret; } |