[openwrt/openwrt] hostapd: fix an AP+STA corner case on MLO APs

LEDE Commits lede-commits at lists.infradead.org
Mon Sep 29 03:37:14 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/80d73707b04a46e109b27907c8997068f94e26f4

commit 80d73707b04a46e109b27907c8997068f94e26f4
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Sep 28 20:55:57 2025 +0200

    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 <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.uc  | 28 ++++++++++++----------
 .../network/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;




More information about the lede-commits mailing list