diff options
author | Danny Kukawka <danny.kukawka@bisect.de> | 2012-02-15 01:45:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-15 15:34:17 -0500 |
commit | 7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0 (patch) | |
tree | 2b284365b7a2e11d4ba286a589bd35bc39918805 /drivers/net/dummy.c | |
parent | f2cedb63df14342ad40a8b5b324fc5d94a60b665 (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/dummy.c')
-rw-r--r-- | drivers/net/dummy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index 087648ea1edb..d5c6d92f1ee7 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -47,6 +47,7 @@ static int dummy_set_address(struct net_device *dev, void *p) | |||
47 | if (!is_valid_ether_addr(sa->sa_data)) | 47 | if (!is_valid_ether_addr(sa->sa_data)) |
48 | return -EADDRNOTAVAIL; | 48 | return -EADDRNOTAVAIL; |
49 | 49 | ||
50 | dev->addr_assign_type &= ~NET_ADDR_RANDOM; | ||
50 | memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); | 51 | memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); |
51 | return 0; | 52 | return 0; |
52 | } | 53 | } |
@@ -135,7 +136,7 @@ static void dummy_setup(struct net_device *dev) | |||
135 | dev->flags &= ~IFF_MULTICAST; | 136 | dev->flags &= ~IFF_MULTICAST; |
136 | dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO; | 137 | dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO; |
137 | dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX; | 138 | dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX; |
138 | random_ether_addr(dev->dev_addr); | 139 | eth_hw_addr_random(dev); |
139 | } | 140 | } |
140 | 141 | ||
141 | static int dummy_validate(struct nlattr *tb[], struct nlattr *data[]) | 142 | static int dummy_validate(struct nlattr *tb[], struct nlattr *data[]) |