From 96c53518ffdd470768a224fbdb697294639a8370 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 22 Nov 2016 10:43:25 +0100 Subject: [PATCH] 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 --- bridge.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.30.2