diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ed56b0c6fe19..7c6edb7c5f10 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1549,6 +1549,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
1549 | if (!is_valid_ether_addr(mac)) | 1549 | if (!is_valid_ether_addr(mac)) |
1550 | return -EINVAL; | 1550 | return -EINVAL; |
1551 | 1551 | ||
1552 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER) && | ||
1553 | sdata->vif.type == NL80211_IFTYPE_STATION && | ||
1554 | !sdata->u.mgd.associated) | ||
1555 | return -EINVAL; | ||
1556 | |||
1552 | sta = sta_info_alloc(sdata, mac, GFP_KERNEL); | 1557 | sta = sta_info_alloc(sdata, mac, GFP_KERNEL); |
1553 | if (!sta) | 1558 | if (!sta) |
1554 | return -ENOMEM; | 1559 | return -ENOMEM; |
@@ -1556,10 +1561,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
1556 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) | 1561 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) |
1557 | sta->sta.tdls = true; | 1562 | sta->sta.tdls = true; |
1558 | 1563 | ||
1559 | if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION && | ||
1560 | !sdata->u.mgd.associated) | ||
1561 | return -EINVAL; | ||
1562 | |||
1563 | err = sta_apply_parameters(local, sta, params); | 1564 | err = sta_apply_parameters(local, sta, params); |
1564 | if (err) { | 1565 | if (err) { |
1565 | sta_info_free(local, sta); | 1566 | sta_info_free(local, sta); |