summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-03-16 18:42:44 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 16:41:56 -0400
commitfab7d4a2b1d8ce47b69a133f6f9a203b0f12636e (patch)
tree2f4986d07533de83f52719891a02821116d4b932 /net/mac80211
parente048c6e4fdac9be0dbcb7e0c5d518737c867ef09 (diff)
downloadlinux-stable-fab7d4a2b1d8ce47b69a133f6f9a203b0f12636e.tar.gz
linux-stable-fab7d4a2b1d8ce47b69a133f6f9a203b0f12636e.tar.bz2
linux-stable-fab7d4a2b1d8ce47b69a133f6f9a203b0f12636e.zip
mac80211: filter scan results on unusable channels
When you have an AP on channel 13, it will currently often enough be listed in scan results even when the regulatory domain restricts to channels 1-11. This is due to channel overlap. To avoid getting very strange failures, don't show such APs in the scan results. The failure mode will now go from "I can see the AP but not associate" to "I can't see the AP although I know it's there" which is easier to debug. This problem was first really noticed by Jes Sorensen. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: Jes Sorensen <jes@trained-monkey.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_sta.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 8b991ebcbb4e..86da69f44384 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2356,6 +2356,7 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
struct sta_info *sta;
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
u64 beacon_timestamp, rx_timestamp;
+ struct ieee80211_channel *channel;
DECLARE_MAC_BUF(mac);
DECLARE_MAC_BUF(mac2);
@@ -2420,6 +2421,11 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
else
freq = rx_status->freq;
+ channel = ieee80211_get_channel(local->hw.wiphy, freq);
+
+ if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
+ return;
+
#ifdef CONFIG_MAC80211_MESH
if (elems.mesh_config)
bss = ieee80211_rx_mesh_bss_get(dev, elems.mesh_id,