[PATCH] DFS: respect manual channel selection when channels are unaviable

Nicolas Escande nico.escande at gmail.com
Wed Mar 4 06:52:00 PST 2026


When operating on a DFS channel, the code checks whether any of the spanned
subchannels are unavailable & selects a new operating channel if need be. This
is all good when using ACS as we do not care for the exact channel used in the
end but it shouldn't happen when the user explicitely provided a specific
channel number to use. We should respect it.

Signed-off-by: Nicolas Escande <nico.escande at gmail.com>
---
 src/ap/dfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index afc9f9a30ba6..7d2a22037ad0 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -890,7 +890,8 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
 		wpa_printf(MSG_DEBUG, "DFS %d chans unavailable - choose other channel: %s",
 			   res, res ? "yes": "no");
 		if (res) {
-			if (dfs_set_valid_channel(iface, skip_radar) < 0) {
+			if (iface->conf->channel ||
+			    dfs_set_valid_channel(iface, skip_radar) < 0) {
 				hostapd_set_state(iface, HAPD_IFACE_DFS);
 				return 0;
 			}
-- 
2.53.0




More information about the Hostap mailing list