Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102998
b: refs/heads/master
c: 92c0574
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jun 17, 2008
1 parent 3bb7aef commit 786d8fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43aa1920117801fe9ae3d1fad886b62511e09bee
refs/heads/master: 92c0574f11598c8036f81e27d2e8bdd6eed7d76d
1 change: 1 addition & 0 deletions trunk/net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ static int br_set_mac_address(struct net_device *dev, void *p)
spin_lock_bh(&br->lock);
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
br_stp_change_bridge_id(br, addr->sa_data);
br->flags |= BR_SET_MAC_ADDR;
spin_unlock_bh(&br->lock);

return 0;
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/bridge/br_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ struct net_bridge
struct hlist_head hash[BR_HASH_SIZE];
struct list_head age_list;
unsigned long feature_mask;
unsigned long flags;
#define BR_SET_MAC_ADDR 0x00000001

/* STP */
bridge_id designated_root;
Expand Down
4 changes: 4 additions & 0 deletions trunk/net/bridge/br_stp_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 786d8fb

Please sign in to comment.