From: Felix Fietkau Date: Tue, 22 Nov 2016 09:43:25 +0000 (+0100) Subject: bridge: fix MAC address override on config reload X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=96c53518ffdd470768a224fbdb697294639a8370;p=project%2Fnetifd.git bridge: fix MAC address override on config reload When no MAC address option is given, the MAC address of bst->primary_port is used to override the bridge device address. When the config changes and a new MAC address is provided in the config, bridge_reset_primary needs to stop overriding it Signed-off-by: Felix Fietkau --- diff --git a/bridge.c b/bridge.c index 30fd58d..ba1ce5d 100644 --- a/bridge.c +++ b/bridge.c @@ -655,6 +655,9 @@ bridge_reload(struct device *dev, struct blob_attr *attr) blobmsg_parse(bridge_attrs, __BRIDGE_ATTR_MAX, tb_br, blob_data(attr), blob_len(attr)); + if (tb_dev[DEV_ATTR_MACADDR]) + bst->primary_port = NULL; + bst->ifnames = tb_br[BRIDGE_ATTR_IFNAME]; device_init_settings(dev, tb_dev); bridge_apply_settings(bst, tb_br);