aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2014-10-22 15:23:05 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-27 03:48:33 -0400
commite8f479b11268af3f206d1580f6b0d572d6ecb4f7 (patch)
treecc3e07ffbe5c26c3a928dd1d59bcf3d9d1b378b8 /net
parent9a0cb89a8aad7c04505abf88202b1dd376fc50bc (diff)
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>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d98d4ea27819..12736a7cd506 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2605,7 +2605,9 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
2605 !(rdev->wiphy.interface_modes & (1 << type))) 2605 !(rdev->wiphy.interface_modes & (1 << type)))
2606 return -EOPNOTSUPP; 2606 return -EOPNOTSUPP;
2607 2607
2608 if (type == NL80211_IFTYPE_P2P_DEVICE && info->attrs[NL80211_ATTR_MAC]) { 2608 if ((type == NL80211_IFTYPE_P2P_DEVICE ||
2609 rdev->wiphy.features & NL80211_FEATURE_MAC_ON_CREATE) &&
2610 info->attrs[NL80211_ATTR_MAC]) {
2609 nla_memcpy(params.macaddr, info->attrs[NL80211_ATTR_MAC], 2611 nla_memcpy(params.macaddr, info->attrs[NL80211_ATTR_MAC],
2610 ETH_ALEN); 2612 ETH_ALEN);
2611 if (!is_valid_ether_addr(params.macaddr)) 2613 if (!is_valid_ether_addr(params.macaddr))