diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ebd7fb101fbf..d06c65fa5526 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -832,6 +832,12 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
832 | if (is_multicast_ether_addr(mac)) | 832 | if (is_multicast_ether_addr(mac)) |
833 | return -EINVAL; | 833 | return -EINVAL; |
834 | 834 | ||
835 | /* Only TDLS-supporting stations can add TDLS peers */ | ||
836 | if ((params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) && | ||
837 | !((wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) && | ||
838 | sdata->vif.type == NL80211_IFTYPE_STATION)) | ||
839 | return -ENOTSUPP; | ||
840 | |||
835 | sta = sta_info_alloc(sdata, mac, GFP_KERNEL); | 841 | sta = sta_info_alloc(sdata, mac, GFP_KERNEL); |
836 | if (!sta) | 842 | if (!sta) |
837 | return -ENOMEM; | 843 | return -ENOMEM; |
@@ -841,12 +847,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
841 | 847 | ||
842 | sta_apply_parameters(local, sta, params); | 848 | sta_apply_parameters(local, sta, params); |
843 | 849 | ||
844 | /* Only TDLS-supporting stations can add TDLS peers */ | ||
845 | if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && | ||
846 | !((wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) && | ||
847 | sdata->vif.type == NL80211_IFTYPE_STATION)) | ||
848 | return -ENOTSUPP; | ||
849 | |||
850 | rate_control_rate_init(sta); | 850 | rate_control_rate_init(sta); |
851 | 851 | ||
852 | layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN || | 852 | layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN || |