From a6969351a7bf2e38deff37480c172230e61177f2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 4 May 2026 12:02:41 +0000 Subject: [PATCH] hostapd: clear start_disabled when adding a BSS to an enabled iface In AP+STA mode, wifi-scripts emits start_disabled=1 in the per-BSS section of the generated hostapd config so that hostapd defers beaconing on every BSS until apsta_state up clears the flag for the whole iface (uc_hostapd_iface_start clears start_disabled on every BSS and calls ieee802_11_set_beacon). When a new BSS is added later via iface.add_bss while the iface is already in HAPD_IFACE_ENABLED state, the freshly parsed config still carries start_disabled=1 for that BSS. hostapd_setup_bss is invoked with start_beacon=true, but hostapd_start_beacon then skips ieee802_11_set_beacon because conf->start_disabled is set. The kernel netdev is created without ever starting beacons, the carrier never comes up, and probe-response transmission attempts fail with "handle_probe_req: send failed". Mirror what iface.start does: when the iface is already enabled, the apsta channel selection has happened, so clear start_disabled for the incoming BSS before starting it. Signed-off-by: Felix Fietkau --- package/network/services/hostapd/src/src/ap/ucode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index 5c5cf29999..e1a365b7a6 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -457,9 +457,11 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, size_t nargs) interfaces->ctrl_iface_init(hapd) < 0) goto free_hapd; - if (iface->state == HAPD_IFACE_ENABLED && - hostapd_setup_bss(hapd, -1, true)) - goto deinit_ctrl; + if (iface->state == HAPD_IFACE_ENABLED) { + hapd->conf->start_disabled = 0; + if (hostapd_setup_bss(hapd, -1, true)) + goto deinit_ctrl; + } iface->bss = os_realloc_array(iface->bss, iface->num_bss + 1, sizeof(*iface->bss));