]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
hostapd: fix bss config reload while in DFS state
authorFelix Fietkau <nbd@nbd.name>
Sat, 5 Jul 2025 18:45:48 +0000 (20:45 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 2 Aug 2025 14:46:59 +0000 (16:46 +0200)
Only start a BSS after a config change if it was started before.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/src/src/ap/ucode.c

index cbe2ee9506a5ef8ec62f5cc3c862be5ee89fe2f2..081872ebe8be366378602cb4dc6dc509208527f2 100644 (file)
@@ -256,6 +256,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
        uc_value_t *files_only = uc_fn_arg(2);
        unsigned int i, idx = 0;
        int ret = -1;
+       bool started;
 
        if (!hapd || ucv_type(file) != UC_STRING)
                goto out;
@@ -287,6 +288,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
                goto free;
        }
 
+       started = hapd->started;
        __uc_hostapd_bss_stop(hapd);
 
        old_bss = hapd->conf;
@@ -299,7 +301,10 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
        if (hapd == iface->bss[0])
                memcpy(hapd->own_addr, hapd->conf->bssid, ETH_ALEN);
 
-       ret = __uc_hostapd_bss_start(hapd);
+       if (started)
+               ret = __uc_hostapd_bss_start(hapd);
+       else
+               ret = 0;
        hostapd_ucode_update_interfaces();
 
 free: