aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_device.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-12-08 02:17:49 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-08 19:40:28 -0500
commit43598813386f6205edf3c21f1fe97f731ccb4f15 (patch)
treee08befb899b76681fac2af8acb13150b0b74d44f /net/bridge/br_device.c
parent31e8a49c161b00c648e960903512c9cbaee777b1 (diff)
bridge: add local MAC address to forwarding table (v2)
If user has configured a MAC address that is not one of the existing ports of the bridge, then we need to add a special entry in the forwarding table. This forwarding table entry has no outgoing port so it has to be treated a little differently. The special entry is reported by the netlink interface with ifindex of bridge, but ignored by the old interface since there is no usable way to put it in the ABI. Reported-by: Koki Sanagi <sanagi.koki@jp.fujitsu.com> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_device.c')
-rw-r--r--net/bridge/br_device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index a3754ac262c3..71773b014e0c 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -170,8 +170,11 @@ static int br_set_mac_address(struct net_device *dev, void *p)
170 return -EINVAL; 170 return -EINVAL;
171 171
172 spin_lock_bh(&br->lock); 172 spin_lock_bh(&br->lock);
173 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 173 if (compare_ether_addr(dev->dev_addr, addr->sa_data)) {
174 br_stp_change_bridge_id(br, addr->sa_data); 174 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
175 br_fdb_change_mac_address(br, addr->sa_data);
176 br_stp_change_bridge_id(br, addr->sa_data);
177 }
175 br->flags |= BR_SET_MAC_ADDR; 178 br->flags |= BR_SET_MAC_ADDR;
176 spin_unlock_bh(&br->lock); 179 spin_unlock_bh(&br->lock);
177 180