aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/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/mac80211/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/mac80211/scan.c')
-rw-r--r--net/mac80211/scan.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 88a9a1be314a..4cf387c944bf 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -614,23 +614,14 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
614{ 614{
615 int skip; 615 int skip;
616 struct ieee80211_channel *chan; 616 struct ieee80211_channel *chan;
617 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
618 617
619 skip = 0; 618 skip = 0;
620 chan = local->scan_req->channels[local->scan_channel_idx]; 619 chan = local->scan_req->channels[local->scan_channel_idx];
621 620
622 if (chan->flags & IEEE80211_CHAN_DISABLED || 621 local->scan_channel = chan;
623 (sdata->vif.type == NL80211_IFTYPE_ADHOC && 622 if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL))
624 chan->flags & IEEE80211_CHAN_NO_IBSS))
625 skip = 1; 623 skip = 1;
626 624
627 if (!skip) {
628 local->scan_channel = chan;
629 if (ieee80211_hw_config(local,
630 IEEE80211_CONF_CHANGE_CHANNEL))
631 skip = 1;
632 }
633
634 /* advance state machine to next channel/band */ 625 /* advance state machine to next channel/band */
635 local->scan_channel_idx++; 626 local->scan_channel_idx++;
636 627