]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Clear cac_started when AP is disabled
authorQiwei Cai <quic_qcai@quicinc.com>
Wed, 14 Dec 2022 06:56:14 +0000 (14:56 +0800)
committerJouni Malinen <j@w1.fi>
Thu, 15 Dec 2022 16:43:43 +0000 (18:43 +0200)
When AP is started on a DFS channel and DFS is offloaded to the driver,
AP setup will be separated to two stages. In the first stage, hostapd
will set frequency and initialize BSS, then waits the driver CAC to
complete. Once CAC done, in the second stage,
hostapd_setup_interface_complete() will be called again from a callback
to continue AP/channel setup.

But the driver will fail to restart AP if it is disabled/reenabled
during a driver CAC procedure because some steps such as setting
freq/beacon in the first stage are skipped due to cac_started not
cleared when the AP is disabled.

Avoid this by clearing cac_started when the AP is disabled.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/hostapd.c

index a0f865a7b84675c4e56bad3b3cb4ec613a0839d3..58492e51edae51e5398446f2db7575992685f030 100644 (file)
@@ -559,6 +559,7 @@ void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
        iface->current_rates = NULL;
        os_free(iface->basic_rates);
        iface->basic_rates = NULL;
+       iface->cac_started = 0;
        ap_list_deinit(iface);
        sta_track_deinit(iface);
        airtime_policy_update_deinit(iface);