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 <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2023-09-13 17:07:17 +02:00
parent a463bd8c99
commit 7365e8f1bb

View file

@ -394,7 +394,7 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
struct hostapd_data *hapd = iface->bss[i]; struct hostapd_data *hapd = iface->bss[i];
hostapd_drv_stop_ap(hapd); 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]; struct hostapd_data *hapd = iface->bss[i];
int ret; int ret;
hapd->started = 1;
hapd->conf->start_disabled = 0; hapd->conf->start_disabled = 0;
hostapd_set_freq(hapd, conf->hw_mode, iface->freq, hostapd_set_freq(hapd, conf->hw_mode, iface->freq,
conf->channel, conf->channel,