summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-03-04 09:50:13 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-03-19 16:29:56 -0400
commit3afc2167f60a327a2c1e1e2600ef209a3c2b75b7 (patch)
tree2588b9503edc6b574126f54eee64ccb00aceb863 /net/mac80211/mlme.c
parent2316d7b0544c4601cc852c801c93d1f451378740 (diff)
cfg80211/mac80211: ignore signal if the frame was heard on wrong channel
On 2.4Ghz band, the channels overlap since the delta between different channels is 5Mhz while the width of the receiver is 20Mhz (at least). This means that we can hear beacons or probe responses from adjacent channels. These frames will have a significant lower RSSI which will feed all kinds of logic with inaccurate data. An obvious example is the roaming algorithm that will think our AP is getting weak and will try to move to another AP. In order to avoid this, update the signal only if the frame has been heard on the same channel as the one advertised by the AP in its DS / HT IEs. We refrain from updating the values only if the AP is already in the BSS list so that we will still have a valid (but inaccurate) value if the AP was heard on an adjacent channel only. To achieve this, stop taking the channel from DS / HT IEs in mac80211. The DS / HT IEs is taken into account to discard the frame if it was received on a disabled channel. This can happen due to the same phenomenon: the frame is sent on channel 12, but heard on channel 11 while channel 12 can be disabled on certain devices. Since this check is done in cfg80211, stop even checking this in mac80211. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> [remove unused rx_freq variable] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 6d24e6c8f320..bbc2175e4bfe 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2760,21 +2760,13 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2760 struct ieee802_11_elems *elems) 2760 struct ieee802_11_elems *elems)
2761{ 2761{
2762 struct ieee80211_local *local = sdata->local; 2762 struct ieee80211_local *local = sdata->local;
2763 int freq;
2764 struct ieee80211_bss *bss; 2763 struct ieee80211_bss *bss;
2765 struct ieee80211_channel *channel; 2764 struct ieee80211_channel *channel;
2766 2765
2767 sdata_assert_lock(sdata); 2766 sdata_assert_lock(sdata);
2768 2767
2769 if (elems->ds_params) 2768 channel = ieee80211_get_channel(local->hw.wiphy, rx_status->freq);
2770 freq = ieee80211_channel_to_frequency(elems->ds_params[0], 2769 if (!channel)
2771 rx_status->band);
2772 else
2773 freq = rx_status->freq;
2774
2775 channel = ieee80211_get_channel(local->hw.wiphy, freq);
2776
2777 if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
2778 return; 2770 return;
2779 2771
2780 bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems, 2772 bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems,