diff mbox series

ACS: honor acs_exclude_dfs with hostapd's ACS implementation

Message ID 20220324124559.279660-1-nico.escande@gmail.com
State Accepted
Headers show
Series ACS: honor acs_exclude_dfs with hostapd's ACS implementation | expand

Commit Message

Nicolas Escande March 24, 2022, 12:46 p.m. UTC
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 our ACS
implementation to exclude channels marked with radar detection.

Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
---
 src/ap/acs.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Jouni Malinen April 17, 2022, 4:52 p.m. UTC | #1
On Thu, Mar 24, 2022 at 01:46:00PM +0100, Nicolas Escande wrote:
> 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 our ACS
> implementation to exclude channels marked with radar detection.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/ap/acs.c b/src/ap/acs.c
index ef665052c..e2ac1d0d3 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -541,6 +541,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;
 
@@ -671,6 +675,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;
 
@@ -1045,7 +1053,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))