From 80d73707b04a46e109b27907c8997068f94e26f4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 28 Sep 2025 20:55:57 +0200 Subject: [PATCH] hostapd: fix an AP+STA corner case on MLO APs Bring up AP interfaces, even if no frequency update was provided. Fixes bringup when a MLO STA on the same radios connects to fewer links than available, or to a non-MLD AP. Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.uc | 28 ++++++++++--------- .../services/hostapd/src/src/ap/ucode.c | 4 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 2679fb1ee1..c4ebfdd9a1 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -1166,20 +1166,22 @@ let main_obj = { return 0; } - if (!req.args.frequency) - return libubus.STATUS_INVALID_ARGUMENT; - - let freq_info = iface_freq_info(iface, config, req.args); - if (!freq_info) - return libubus.STATUS_UNKNOWN_ERROR; - - let ret; - if (req.args.csa) { - freq_info.csa_count = req.args.csa_count ?? 10; - ret = iface.switch_channel(freq_info); - } else { - ret = iface.start(freq_info); + let freq_info; + if (req.args.frequency) { + freq_info = iface_freq_info(iface, config, req.args); + if (!freq_info) + return libubus.STATUS_UNKNOWN_ERROR; + + if (req.args.csa) { + freq_info.csa_count = req.args.csa_count ?? 10; + let ret = iface.switch_channel(freq_info); + if (!ret) + return libubus.STATUS_UNKNOWN_ERROR; + return 0; + } } + + let ret = iface.start(freq_info); if (!ret) return libubus.STATUS_UNKNOWN_ERROR; diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index ecd7203590..cca487c356 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -582,10 +582,8 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs) if (!iface) return NULL; - if (!info) { - iface->freq = 0; + if (!info) goto out; - } if (ucv_type(info) != UC_OBJECT) return NULL; -- 2.30.2