aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-12-14 06:20:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-15 14:45:45 -0500
commitbdd90d5e36a55271beb957b3d7ca3e29b2a90207 (patch)
tree79243e73e6c64217bc676507504b72a2d59fc096 /net/mac80211
parentd83023daa219486e9aa139d423308a045bf0438b (diff)
cfg80211: validate nl80211 station handling better
The nl80211 station handling code is a bit messy and doesn't do a lot of validation. It seems like this could be an issue for drivers that don't use mac80211 to validate everything. As cfg80211 doesn't keep station state, move the validation of allowing supported_rates to change for TDLS only in station mode to mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 393b2a4445b8..944051b43bad 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -976,6 +976,14 @@ static int ieee80211_change_station(struct wiphy *wiphy,
976 return -EINVAL; 976 return -EINVAL;
977 } 977 }
978 978
979 /* in station mode, supported rates are only valid with TDLS */
980 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
981 params->supported_rates &&
982 !test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
983 rcu_read_unlock();
984 return -EINVAL;
985 }
986
979 if (params->vlan && params->vlan != sta->sdata->dev) { 987 if (params->vlan && params->vlan != sta->sdata->dev) {
980 vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); 988 vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
981 989