aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2011-09-15 08:10:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-20 14:43:48 -0400
commite30815016bbd0b5c3dcdc29f53e054b57938f1aa (patch)
tree2a7127363a6085b2fb3fbdf9045cce2ac2ee40d0 /net/wireless/sme.c
parent4d8b61490c14a36efdee4a8bf523e26809df05ac (diff)
wireless: Do not allow disabled channel in scan request
cfg80211_conn_scan allows disabled channels at scan request. Hence probe request was seen at the disabled one. This patch ensures that disabled channel never be added into the scan request's channel list. Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index dec0fa28372e..6e86d5acf145 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -110,17 +110,22 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
110 else { 110 else {
111 int i = 0, j; 111 int i = 0, j;
112 enum ieee80211_band band; 112 enum ieee80211_band band;
113 struct ieee80211_supported_band *bands;
114 struct ieee80211_channel *channel;
113 115
114 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 116 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
115 if (!wdev->wiphy->bands[band]) 117 bands = wdev->wiphy->bands[band];
118 if (!bands)
116 continue; 119 continue;
117 for (j = 0; j < wdev->wiphy->bands[band]->n_channels; 120 for (j = 0; j < bands->n_channels; j++) {
118 i++, j++) 121 channel = &bands->channels[j];
119 request->channels[i] = 122 if (channel->flags & IEEE80211_CHAN_DISABLED)
120 &wdev->wiphy->bands[band]->channels[j]; 123 continue;
121 request->rates[band] = 124 request->channels[i++] = channel;
122 (1 << wdev->wiphy->bands[band]->n_bitrates) - 1; 125 }
126 request->rates[band] = (1 << bands->n_bitrates) - 1;
123 } 127 }
128 n_channels = i;
124 } 129 }
125 request->n_channels = n_channels; 130 request->n_channels = n_channels;
126 request->ssids = (void *)&request->channels[n_channels]; 131 request->ssids = (void *)&request->channels[n_channels];