diff options
author | Rajkumar Manoharan <rmanohar@qca.qualcomm.com> | 2011-09-15 17:40:50 +0530 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-20 14:43:48 -0400 |
commit | e30815016bbd0b5c3dcdc29f53e054b57938f1aa (patch) | |
tree | 2a7127363a6085b2fb3fbdf9045cce2ac2ee40d0 /net | |
parent | 4d8b61490c14a36efdee4a8bf523e26809df05ac (diff) | |
download | op-kernel-dev-e30815016bbd0b5c3dcdc29f53e054b57938f1aa.zip op-kernel-dev-e30815016bbd0b5c3dcdc29f53e054b57938f1aa.tar.gz |
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')
-rw-r--r-- | net/wireless/sme.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index dec0fa2..6e86d5a 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -110,17 +110,22 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev) else { int i = 0, j; enum ieee80211_band band; + struct ieee80211_supported_band *bands; + struct ieee80211_channel *channel; for (band = 0; band < IEEE80211_NUM_BANDS; band++) { - if (!wdev->wiphy->bands[band]) + bands = wdev->wiphy->bands[band]; + if (!bands) continue; - for (j = 0; j < wdev->wiphy->bands[band]->n_channels; - i++, j++) - request->channels[i] = - &wdev->wiphy->bands[band]->channels[j]; - request->rates[band] = - (1 << wdev->wiphy->bands[band]->n_bitrates) - 1; + for (j = 0; j < bands->n_channels; j++) { + channel = &bands->channels[j]; + if (channel->flags & IEEE80211_CHAN_DISABLED) + continue; + request->channels[i++] = channel; + } + request->rates[band] = (1 << bands->n_bitrates) - 1; } + n_channels = i; } request->n_channels = n_channels; request->ssids = (void *)&request->channels[n_channels]; |