diff options
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_device.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 71773b014e0c..ba829de84423 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -167,10 +167,11 @@ static int br_set_mac_address(struct net_device *dev, void *p) | |||
167 | struct sockaddr *addr = p; | 167 | struct sockaddr *addr = p; |
168 | 168 | ||
169 | if (!is_valid_ether_addr(addr->sa_data)) | 169 | if (!is_valid_ether_addr(addr->sa_data)) |
170 | return -EINVAL; | 170 | return -EADDRNOTAVAIL; |
171 | 171 | ||
172 | spin_lock_bh(&br->lock); | 172 | spin_lock_bh(&br->lock); |
173 | if (compare_ether_addr(dev->dev_addr, addr->sa_data)) { | 173 | if (compare_ether_addr(dev->dev_addr, addr->sa_data)) { |
174 | dev->addr_assign_type &= ~NET_ADDR_RANDOM; | ||
174 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 175 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); |
175 | br_fdb_change_mac_address(br, addr->sa_data); | 176 | br_fdb_change_mac_address(br, addr->sa_data); |
176 | br_stp_change_bridge_id(br, addr->sa_data); | 177 | br_stp_change_bridge_id(br, addr->sa_data); |
@@ -334,7 +335,7 @@ void br_dev_setup(struct net_device *dev) | |||
334 | { | 335 | { |
335 | struct net_bridge *br = netdev_priv(dev); | 336 | struct net_bridge *br = netdev_priv(dev); |
336 | 337 | ||
337 | random_ether_addr(dev->dev_addr); | 338 | eth_hw_addr_random(dev); |
338 | ether_setup(dev); | 339 | ether_setup(dev); |
339 | 340 | ||
340 | dev->netdev_ops = &br_netdev_ops; | 341 | dev->netdev_ops = &br_netdev_ops; |