From: Felix Fietkau Date: Tue, 17 Nov 2015 14:05:01 +0000 (+0100) Subject: device: preserve orig_settings flags for querying device status X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=5a0328c7b039a90e988aaab8e03eb8ce5508d62b;p=project%2Fnetifd.git device: preserve orig_settings flags for querying device status Signed-off-by: Felix Fietkau --- diff --git a/device.c b/device.c index a29c981..67e9d9a 100644 --- a/device.c +++ b/device.c @@ -174,7 +174,7 @@ device_merge_settings(struct device *dev, struct device_settings *n) s->dadtransmits : os->dadtransmits; n->multicast_to_unicast = s->multicast_to_unicast; n->multicast_router = s->multicast_router; - n->flags = s->flags | os->flags; + n->flags = s->flags | os->flags | os->valid_flags; } void diff --git a/device.h b/device.h index 4ff335d..a6c131a 100644 --- a/device.h +++ b/device.h @@ -128,6 +128,7 @@ struct device_user { struct device_settings { unsigned int flags; + unsigned int valid_flags; unsigned int mtu; unsigned int mtu6; unsigned int txqueuelen; diff --git a/system-linux.c b/system-linux.c index 4ccc9d2..b190ec6 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1225,6 +1225,7 @@ 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.valid_flags = dev->orig_settings.flags; 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);