aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h4
-rw-r--r--net/wireless/nl80211.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d9f08f65f7a5..d81e730962cc 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -281,9 +281,13 @@ struct ieee80211_supported_band {
281/** 281/**
282 * struct vif_params - describes virtual interface parameters 282 * struct vif_params - describes virtual interface parameters
283 * @use_4addr: use 4-address frames 283 * @use_4addr: use 4-address frames
284 * @macaddr: address to use for this virtual interface. This will only
285 * be used for non-netdevice interfaces. If this parameter is set
286 * to zero address the driver may determine the address as needed.
284 */ 287 */
285struct vif_params { 288struct vif_params {
286 int use_4addr; 289 int use_4addr;
290 u8 macaddr[ETH_ALEN];
287}; 291};
288 292
289/** 293/**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1a7a710fe9bf..d543cf152100 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2079,6 +2079,13 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
2079 !(rdev->wiphy.interface_modes & (1 << type))) 2079 !(rdev->wiphy.interface_modes & (1 << type)))
2080 return -EOPNOTSUPP; 2080 return -EOPNOTSUPP;
2081 2081
2082 if (type == NL80211_IFTYPE_P2P_DEVICE && info->attrs[NL80211_ATTR_MAC]) {
2083 nla_memcpy(params.macaddr, info->attrs[NL80211_ATTR_MAC],
2084 ETH_ALEN);
2085 if (!is_valid_ether_addr(params.macaddr))
2086 return -EADDRNOTAVAIL;
2087 }
2088
2082 if (info->attrs[NL80211_ATTR_4ADDR]) { 2089 if (info->attrs[NL80211_ATTR_4ADDR]) {
2083 params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]); 2090 params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]);
2084 err = nl80211_valid_4addr(rdev, NULL, params.use_4addr, type); 2091 err = nl80211_valid_4addr(rdev, NULL, params.use_4addr, type);