summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-03-08 05:12:10 -0500
committerJohannes Berg <johannes.berg@intel.com>2017-03-08 08:20:01 -0500
commite8e4f5280ddd0a7b43a795f90a0758e3c99df6a6 (patch)
tree749391b6ba269af098d9ee4810b1dc24abf86d4a /net/mac80211/mlme.c
parentb61fbda180b5c9f5f3ce7f2e63b0253c84ffdf09 (diff)
mac80211: reject/clear user rate mask if not usable
If the user rate mask results in no (basic) rates being usable, clear it. Also, if we're already operating when it's set, reject it instead. Technically, selecting basic rates as the criterion is a bit too restrictive, but calculating the usable rates over all stations (e.g. in AP mode) is harder, and all stations must support the basic rates. Similarly, in client mode, the basic rates will be used anyway for control frames. This fixes the "no supported rates (...) in rate_mask ..." warning that occurs on TX when you've selected a rate mask that's not compatible with the connection (e.g. an AP that enables only the rates 36, 48, 54 and you've selected only 6, 9, 12.) Reported-by: Kirtika Ruchandani <kirtika@google.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 4b4d29edec09..24d69bcf71ad 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1908,6 +1908,8 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1908 sdata->u.mgd.associated = cbss; 1908 sdata->u.mgd.associated = cbss;
1909 memcpy(sdata->u.mgd.bssid, cbss->bssid, ETH_ALEN); 1909 memcpy(sdata->u.mgd.bssid, cbss->bssid, ETH_ALEN);
1910 1910
1911 ieee80211_check_rate_mask(sdata);
1912
1911 sdata->u.mgd.flags |= IEEE80211_STA_RESET_SIGNAL_AVE; 1913 sdata->u.mgd.flags |= IEEE80211_STA_RESET_SIGNAL_AVE;
1912 1914
1913 if (sdata->vif.p2p || 1915 if (sdata->vif.p2p ||