cfg80211: support configuring vif mac addr on create
This is useful when creating virtual interfaces. Keeps udev from mucking with things it shouldn't, since the default MAC is never seen by udev when specified on the cmd-line during creation. Signed-off-by: Ben Greear <greearb@candelatech.com> [check for feature flag in nl80211 to force drivers to set it] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:

committed by
Johannes Berg

parent
9a0cb89a8a
commit
e8f479b112
@@ -2605,7 +2605,9 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
|
||||
!(rdev->wiphy.interface_modes & (1 << type)))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (type == NL80211_IFTYPE_P2P_DEVICE && info->attrs[NL80211_ATTR_MAC]) {
|
||||
if ((type == NL80211_IFTYPE_P2P_DEVICE ||
|
||||
rdev->wiphy.features & NL80211_FEATURE_MAC_ON_CREATE) &&
|
||||
info->attrs[NL80211_ATTR_MAC]) {
|
||||
nla_memcpy(params.macaddr, info->attrs[NL80211_ATTR_MAC],
|
||||
ETH_ALEN);
|
||||
if (!is_valid_ether_addr(params.macaddr))
|
||||
|
Reference in New Issue
Block a user