Skip to content

Commit

Permalink
wireless: Do not allow disabled channel in scan request
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rajkumar Manoharan <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
Rajkumar Manoharan authored and linvjw committed Sep 20, 2011
1 parent 4d8b614 commit e308150
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions net/wireless/sme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit e308150

Please sign in to comment.