From c46351d10e9b98d76ae59f2c2cb5dc776b0cb24d Mon Sep 17 00:00:00 2001 From: Qiwei Cai Date: Wed, 14 Dec 2022 14:56:14 +0800 Subject: [PATCH] DFS: Clear cac_started when AP is disabled 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 --- src/ap/hostapd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index a0f865a7b..58492e51e 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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);