|
@@ -1471,6 +1471,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
|
|
|
if (is_multicast_ether_addr(mac))
|
|
if (is_multicast_ether_addr(mac))
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
|
|
+ if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER) &&
|
|
|
|
|
+ sdata->vif.type == NL80211_IFTYPE_STATION &&
|
|
|
|
|
+ !sdata->u.mgd.associated)
|
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
+
|
|
|
sta = sta_info_alloc(sdata, mac, GFP_KERNEL);
|
|
sta = sta_info_alloc(sdata, mac, GFP_KERNEL);
|
|
|
if (!sta)
|
|
if (!sta)
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -1478,10 +1483,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
|
|
|
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
|
|
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
|
|
|
sta->sta.tdls = true;
|
|
sta->sta.tdls = true;
|
|
|
|
|
|
|
|
- if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION &&
|
|
|
|
|
- !sdata->u.mgd.associated)
|
|
|
|
|
- return -EINVAL;
|
|
|
|
|
-
|
|
|
|
|
err = sta_apply_parameters(local, sta, params);
|
|
err = sta_apply_parameters(local, sta, params);
|
|
|
if (err) {
|
|
if (err) {
|
|
|
sta_info_free(local, sta);
|
|
sta_info_free(local, sta);
|