Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: do not actively scan DFS channels

DFS channels should not be actively scanned as we can't be sure
if we are allowed or not.

If the current channel is in the DFS band, active scan might be
performed after CSA, but we have no guarantee about other channels,
therefore it is safer to prevent active scanning at all.

Cc: stable@vger.kernel.org
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Antonio Quartulli and committed by
Johannes Berg
4e39ccac 835112b2

+5 -4
+5 -4
net/mac80211/scan.c
··· 597 597 /* We need to ensure power level is at max for scanning. */ 598 598 ieee80211_hw_config(local, 0); 599 599 600 - if ((req->channels[0]->flags & 601 - IEEE80211_CHAN_NO_IR) || 600 + if ((req->channels[0]->flags & (IEEE80211_CHAN_NO_IR | 601 + IEEE80211_CHAN_RADAR)) || 602 602 !req->n_ssids) { 603 603 next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; 604 604 } else { ··· 645 645 * TODO: channel switching also consumes quite some time, 646 646 * add that delay as well to get a better estimation 647 647 */ 648 - if (chan->flags & IEEE80211_CHAN_NO_IR) 648 + if (chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)) 649 649 return IEEE80211_PASSIVE_CHANNEL_TIME; 650 650 return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME; 651 651 } ··· 777 777 * 778 778 * In any case, it is not necessary for a passive scan. 779 779 */ 780 - if (chan->flags & IEEE80211_CHAN_NO_IR || !scan_req->n_ssids) { 780 + if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)) || 781 + !scan_req->n_ssids) { 781 782 *next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; 782 783 local->next_scan_state = SCAN_DECISION; 783 784 return;