From 4e86692ff18b7b7f037cad6795325c2e3b989873 Mon Sep 17 00:00:00 2001 From: Pooventhiran G Date: Thu, 23 Feb 2023 22:13:50 +0530 Subject: [PATCH] AP: Fix 6 GHz AP setup after disable-enable Once ACS picks a channel, iface->freq and iface->conf->channel are updated. So, AP comes up in the last operating channel when 'ENABLED' after 'DISABLED' though ACS is configured. But this will fail for 6 GHz APs since configured_fixed_chan_to_freq() checks if iface->conf->channel is filled or not irrespective of ACS configuration, and the checks inside configured_fixed_chan_to_freq() fail the AP setup. Fix this by clearing iface->freq and iface->conf->channel in AP setup for ACS configuration. Fixes: bb781c763f47 ("AP: Populate iface->freq before starting AP") Signed-off-by: Pooventhiran G --- src/ap/hostapd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index c3fd91e43..366b5a195 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1784,6 +1784,11 @@ static int setup_interface2(struct hostapd_iface *iface) } else { int ret; + if (iface->conf->acs) { + iface->freq = 0; + iface->conf->channel = 0; + } + ret = configured_fixed_chan_to_freq(iface); if (ret < 0) goto fail;