]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
hostapd: fix an AP+STA corner case on MLO APs
authorFelix Fietkau <nbd@nbd.name>
Sun, 28 Sep 2025 18:55:57 +0000 (20:55 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 29 Sep 2025 10:37:02 +0000 (12:37 +0200)
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@nbd.name>
package/network/services/hostapd/files/hostapd.uc
package/network/services/hostapd/src/src/ap/ucode.c

index 2679fb1ee1368928bd570115484243c6d99c8b95..c4ebfdd9a132d433f76de74163c4924084b1b528 100644 (file)
@@ -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;
 
index ecd72035908d094c5597b51f7f0a2e29fb3988ad..cca487c3568b8d78b2cac5ddf120fd70382af1ba 100644 (file)
@@ -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;