]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Fix 6 GHz AP setup after disable-enable
authorPooventhiran G <quic_pooventh@quicinc.com>
Thu, 23 Feb 2023 16:43:50 +0000 (22:13 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 9 Mar 2023 19:00:43 +0000 (21:00 +0200)
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 <quic_pooventh@quicinc.com>
src/ap/hostapd.c

index c3fd91e434e9d218fa34dd674420eb5cea1801bc..366b5a195a4024434aba5fe27d667f2a856ff317 100644 (file)
@@ -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;