|
@@ -1671,7 +1671,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
|
|
|
}
|
|
|
|
|
|
ieee80211_assign_perm_addr(local, ndev->perm_addr, type);
|
|
|
- memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN);
|
|
|
+ if (params && is_valid_ether_addr(params->macaddr))
|
|
|
+ memcpy(ndev->dev_addr, params->macaddr, ETH_ALEN);
|
|
|
+ else
|
|
|
+ memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN);
|
|
|
SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
|
|
|
|
|
|
/* don't use IEEE80211_DEV_TO_SUB_IF -- it checks too much */
|