From: Felix Fietkau Date: Wed, 13 Sep 2023 15:07:17 +0000 (+0200) Subject: hostapd: do not modify hapd->started when stopping an AP X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7365e8f1bb5eb4c4fc6b8a03e0f7bed2c7b7b523;p=openwrt%2Fstaging%2Flinusw.git hostapd: do not modify hapd->started when stopping an AP It can cause cleanup to be skipped on wifi restart, which can lead to use-after-free bugs Signed-off-by: Felix Fietkau --- diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index 849f8028e6..3dc122b7c2 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -394,7 +394,7 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs) struct hostapd_data *hapd = iface->bss[i]; hostapd_drv_stop_ap(hapd); - hapd->started = 0; + hapd->beacon_set_done = 0; } } @@ -471,7 +471,6 @@ out: struct hostapd_data *hapd = iface->bss[i]; int ret; - hapd->started = 1; hapd->conf->start_disabled = 0; hostapd_set_freq(hapd, conf->hw_mode, iface->freq, conf->channel,