aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-11-02 07:32:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-02 15:43:29 -0500
commit584991dccfd347cd2e1675ab262998f6c335d3c0 (patch)
tree0cb52e1f06e587561f0e06e1beae7de7faaf5528 /net/wireless/scan.c
parent6c085227bd7168fd84976479218f81bf35b5acd7 (diff)
cfg80211: validate scan channels
Currently it is possible to request a scan on only disabled channels, which could be problematic for some drivers. Reject such scans, and also ignore disabled channels that are given. This resuls in the scan begin/end event only including channels that are actually used. This makes the mac80211 check for disabled channels superfluous. At the same time, remove the no-IBSS check from mac80211 -- nothing says that we should not find any networks on channels that cannot be used for an IBSS, even when operating in IBSS mode. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r--net/wireless/scan.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 2e8c515f3c5c..e2d344ff6745 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -650,9 +650,15 @@ int cfg80211_wext_siwscan(struct net_device *dev,
650 i = 0; 650 i = 0;
651 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 651 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
652 int j; 652 int j;
653
653 if (!wiphy->bands[band]) 654 if (!wiphy->bands[band])
654 continue; 655 continue;
656
655 for (j = 0; j < wiphy->bands[band]->n_channels; j++) { 657 for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
658 /* ignore disabled channels */
659 if (wiphy->bands[band]->channels[j].flags &
660 IEEE80211_CHAN_DISABLED)
661 continue;
656 662
657 /* If we have a wireless request structure and the 663 /* If we have a wireless request structure and the
658 * wireless request specifies frequencies, then search 664 * wireless request specifies frequencies, then search