diff options
author | Danny Kukawka <danny.kukawka@bisect.de> | 2012-02-17 00:43:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-17 15:52:31 -0500 |
commit | 43aabec51e0ab5d71c30530eec55963673354033 (patch) | |
tree | 2d565ef7fa923318e9ecad5656d80b8411e0e0e1 /drivers/net/ethernet/lantiq_etop.c | |
parent | 7718f2c27dbdae0b22b2268a9c1b38edf0d8fa16 (diff) |
lantiq_etop: set addr_assign_type if random_ether_addr() used
Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.
v2: added comment, renamed bool variable to random_mac
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/lantiq_etop.c')
-rw-r--r-- | drivers/net/ethernet/lantiq_etop.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c index 3369b7db777d..e89808ff73ed 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c | |||
@@ -634,6 +634,7 @@ ltq_etop_init(struct net_device *dev) | |||
634 | struct ltq_etop_priv *priv = netdev_priv(dev); | 634 | struct ltq_etop_priv *priv = netdev_priv(dev); |
635 | struct sockaddr mac; | 635 | struct sockaddr mac; |
636 | int err; | 636 | int err; |
637 | bool random_mac = false; | ||
637 | 638 | ||
638 | ether_setup(dev); | 639 | ether_setup(dev); |
639 | dev->watchdog_timeo = 10 * HZ; | 640 | dev->watchdog_timeo = 10 * HZ; |
@@ -646,11 +647,17 @@ ltq_etop_init(struct net_device *dev) | |||
646 | if (!is_valid_ether_addr(mac.sa_data)) { | 647 | if (!is_valid_ether_addr(mac.sa_data)) { |
647 | pr_warn("etop: invalid MAC, using random\n"); | 648 | pr_warn("etop: invalid MAC, using random\n"); |
648 | random_ether_addr(mac.sa_data); | 649 | random_ether_addr(mac.sa_data); |
650 | random_mac = true; | ||
649 | } | 651 | } |
650 | 652 | ||
651 | err = ltq_etop_set_mac_address(dev, &mac); | 653 | err = ltq_etop_set_mac_address(dev, &mac); |
652 | if (err) | 654 | if (err) |
653 | goto err_netdev; | 655 | goto err_netdev; |
656 | |||
657 | /* Set addr_assign_type here, ltq_etop_set_mac_address would reset it. */ | ||
658 | if (random_mac) | ||
659 | dev->addr_assign_type |= NET_ADDR_RANDOM; | ||
660 | |||
654 | ltq_etop_set_multicast_list(dev); | 661 | ltq_etop_set_multicast_list(dev); |
655 | err = ltq_etop_mdio_init(dev); | 662 | err = ltq_etop_mdio_init(dev); |
656 | if (err) | 663 | if (err) |