ACS: Honor acs_exclude_dfs with hostapd's ACS implementation

The acs_exclude_dfs parameter is documented as a way to exclude DFS
channels when performing ACS without disabling DFS altogether. The
problem is this parameter is only enforced when ACS is offloaded to the
driver (WPA_DRIVER_FLAGS_ACS_OFFLOAD). So from now on, lets also check
acs_exclude_dfs in the internal ACS implementation to exclude channels
marked with radar detection.

Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
This commit is contained in:
Nicolas Escande 2022-03-24 13:46:00 +01:00 committed by Jouni Malinen
parent 3240cedd6a
commit 3a759dcc8c

View file

@ -540,6 +540,10 @@ static void acs_survey_mode_interference_factor(
if (!acs_usable_chan(chan))
continue;
if ((chan->flag & HOSTAPD_CHAN_RADAR) &&
iface->conf->acs_exclude_dfs)
continue;
if (!is_in_chanlist(iface, chan))
continue;
@ -670,6 +674,10 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
if (!chan_pri_allowed(chan))
continue;
if ((chan->flag & HOSTAPD_CHAN_RADAR) &&
iface->conf->acs_exclude_dfs)
continue;
if (!is_in_chanlist(iface, chan))
continue;
@ -1044,7 +1052,9 @@ static int * acs_request_scan_add_freqs(struct hostapd_iface *iface,
for (i = 0; i < mode->num_channels; i++) {
chan = &mode->channels[i];
if (chan->flag & HOSTAPD_CHAN_DISABLED)
if ((chan->flag & HOSTAPD_CHAN_DISABLED) ||
((chan->flag & HOSTAPD_CHAN_RADAR) &&
iface->conf->acs_exclude_dfs))
continue;
if (!is_in_chanlist(iface, chan))