From 3a759dcc8c07b56da3d858b5218be8a2dac4642d Mon Sep 17 00:00:00 2001 From: Nicolas Escande Date: Thu, 24 Mar 2022 13:46:00 +0100 Subject: [PATCH] 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 --- src/ap/acs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ap/acs.c b/src/ap/acs.c index 0030edc2a..faaedbfdb 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -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))