]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ACS: Honor acs_exclude_dfs with hostapd's ACS implementation
authorNicolas Escande <nico.escande@gmail.com>
Thu, 24 Mar 2022 12:46:00 +0000 (13:46 +0100)
committerJouni Malinen <j@w1.fi>
Sun, 17 Apr 2022 16:50:23 +0000 (19:50 +0300)
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>
src/ap/acs.c

index 0030edc2a90f1271bb9d8d690dbf3d01bf39499b..faaedbfdb0d91acea15c60e5bf16be60d5471019 100644 (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))