Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3081501 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by John W. Linville
Browse files

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4d8b6149
Loading
Loading
Loading
Loading
+12 −7
Original line number Original line Diff line number Diff line
@@ -110,17 +110,22 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
	else {
	else {
		int i = 0, j;
		int i = 0, j;
		enum ieee80211_band band;
		enum ieee80211_band band;
		struct ieee80211_supported_band *bands;
		struct ieee80211_channel *channel;


		for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
		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 < bands->n_channels; j++) {
				channel = &bands->channels[j];
				if (channel->flags & IEEE80211_CHAN_DISABLED)
					continue;
					continue;
			for (j = 0; j < wdev->wiphy->bands[band]->n_channels;
				request->channels[i++] = channel;
			     i++, j++)
			}
				request->channels[i] =
			request->rates[band] = (1 << bands->n_bitrates) - 1;
					&wdev->wiphy->bands[band]->channels[j];
			request->rates[band] =
				(1 << wdev->wiphy->bands[band]->n_bitrates) - 1;
		}
		}
		n_channels = i;
	}
	}
	request->n_channels = n_channels;
	request->n_channels = n_channels;
	request->ssids = (void *)&request->channels[n_channels];
	request->ssids = (void *)&request->channels[n_channels];