summaryrefslogtreecommitdiff
path: root/net/bridge/br_stp_if.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-06-17 23:10:06 (GMT)
committerDavid S. Miller <davem@davemloft.net>2008-06-17 23:10:06 (GMT)
commit92c0574f11598c8036f81e27d2e8bdd6eed7d76d (patch)
tree179c0a8ef7291cc65a692043310b543d35c16eac /net/bridge/br_stp_if.c
parent43aa1920117801fe9ae3d1fad886b62511e09bee (diff)
downloadlinux-92c0574f11598c8036f81e27d2e8bdd6eed7d76d.tar.xz
bridge: make bridge address settings sticky
Normally, the bridge just chooses the smallest mac address as the bridge id and mac address of bridge device. But if the administrator has explictly set the interface address then don't change it. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_stp_if.c')
-rw-r--r--net/bridge/br_stp_if.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 1a4e5c3..9a52ac5 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -214,6 +214,10 @@ void br_stp_recalculate_bridge_id(struct net_bridge *br)
const unsigned char *addr = br_mac_zero;
struct net_bridge_port *p;
+ /* user has chosen a value so keep it */
+ if (br->flags & BR_SET_MAC_ADDR)
+ return;
+
list_for_each_entry(p, &br->port_list, list) {
if (addr == br_mac_zero ||
memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0)