mac80211: support ETHTOOL_GPERMADDR
authorJohn W. Linville <linville@tuxdriver.com>
Tue, 6 Oct 2009 20:27:18 +0000 (16:27 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:48 +0000 (16:39 -0400)
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/iface.c

index f6005adcbf90e794a5a3a5b5518aa375553eedd3..87aff1d923ba0ac268cebc768d866df66c6049d2 100644 (file)
@@ -184,10 +184,12 @@ static int ieee80211_open(struct net_device *dev)
                 * No need to check netif_running since we do not allow
                 * it to start up with this invalid address.
                 */
-               if (compare_ether_addr(null_addr, ndev->dev_addr) == 0)
+               if (compare_ether_addr(null_addr, ndev->dev_addr) == 0) {
                        memcpy(ndev->dev_addr,
                               local->hw.wiphy->perm_addr,
                               ETH_ALEN);
+                       memcpy(ndev->perm_addr, ndev->dev_addr, ETH_ALEN);
+               }
        }
 
        /*
@@ -784,6 +786,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
                goto fail;
 
        memcpy(ndev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
+       memcpy(ndev->perm_addr, ndev->dev_addr, ETH_ALEN);
        SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
 
        /* don't use IEEE80211_DEV_TO_SUB_IF because it checks too much */