wifi-scripts: fix MLO AP setup with disabled radios
authorFelix Fietkau <[email protected]>
Thu, 13 Nov 2025 11:52:47 +0000 (11:52 +0000)
committerFelix Fietkau <[email protected]>
Thu, 13 Nov 2025 11:56:39 +0000 (11:56 +0000)
When an MLO interface specifies multiple radios and the first radio
is disabled, the MLO configuration was never created because the code
only attempted to create it when processing the first device in the
list (which gets skipped if disabled).

Fix by creating the MLO config for the first enabled device instead
of only when processing dev_names[0].

Reported-by: Michael-cy Lee (李峻宇) <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
package/network/config/wifi-scripts/files/lib/netifd/wireless.uc

index 5be01aaa2aa8d67d5a363728c6f6c2807c7ded24..5f64104c8b6ca0cdb2d3661d0ac5e6155ac13903 100644 (file)
@@ -135,6 +135,7 @@ function config_init(uci)
                radios = filter(radios, (v) => v != null);
                let radio_config = map(dev_names, (v) => devices[v].config);
                let ifname;
+               let mlo_created = false;
 
                for (let dev_name in dev_names) {
                        let dev = devices[dev_name];
@@ -148,7 +149,7 @@ function config_init(uci)
                        let config = parse_attribute_list(data, handler.iface);
                        config.radios = radios;
 
-                       if (mlo_vif && dev_name == dev_names[0]) {
+                       if (mlo_vif && !mlo_created) {
                                let mlo_config = { ...config };
 
                                if (config.wds)
@@ -162,6 +163,7 @@ function config_init(uci)
                                }
 
                                mlo_vifs[ifname] = mlo_config;
+                               mlo_created = true;
                        }
 
                        if (ifname)