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>
This commit is contained in:

committed by
David S. Miller

parent
43aa192011
commit
92c0574f11
@@ -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)
|
||||
|
Reference in New Issue
Block a user