aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorDanny Kukawka <danny.kukawka@bisect.de>2012-02-15 01:45:40 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-15 15:34:17 -0500
commit7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0 (patch)
tree2b284365b7a2e11d4ba286a589bd35bc39918805 /drivers/net/macvlan.c
parentf2cedb63df14342ad40a8b5b324fc5d94a60b665 (diff)
net: use eth_hw_addr_random() and reset addr_assign_type
Use eth_hw_addr_random() instead of calling random_ether_addr() to set addr_assign_type correctly to NET_ADDR_RANDOM. Reset the state to NET_ADDR_PERM as soon as the MAC get changed via .ndo_set_mac_address. v2: adapt to renamed eth_hw_addr_random() Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 9ea99217f116..f975afdc315c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -372,6 +372,7 @@ static int macvlan_set_mac_address(struct net_device *dev, void *p)
372 372
373 if (!(dev->flags & IFF_UP)) { 373 if (!(dev->flags & IFF_UP)) {
374 /* Just copy in the new address */ 374 /* Just copy in the new address */
375 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
375 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 376 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
376 } else { 377 } else {
377 /* Rehash and update the device filters */ 378 /* Rehash and update the device filters */
@@ -687,7 +688,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
687 return -EINVAL; 688 return -EINVAL;
688 689
689 if (!tb[IFLA_ADDRESS]) 690 if (!tb[IFLA_ADDRESS])
690 random_ether_addr(dev->dev_addr); 691 eth_hw_addr_random(dev);
691 692
692 if (!macvlan_port_exists(lowerdev)) { 693 if (!macvlan_port_exists(lowerdev)) {
693 err = macvlan_port_create(lowerdev); 694 err = macvlan_port_create(lowerdev);