wifi-scripts: iface should be optional in wifi-station definition
authorRany Hany <[email protected]>
Sun, 16 Nov 2025 14:37:49 +0000 (14:37 +0000)
committerRobert Marko <[email protected]>
Tue, 25 Nov 2025 10:45:24 +0000 (11:45 +0100)
Similar to "wifi-scripts: iface should be optional in wifi-vlan definition"
(98435a3), wifi-station iface should also be optional. By default, it is
supposed to match all interfaces if omitted.

Fixes: https://github.com/openwrt/openwrt/issues/20705
Signed-off-by: Rany Hany <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20694
Signed-off-by: Robert Marko <[email protected]>
package/network/config/wifi-scripts/files/lib/netifd/wireless.uc

index 5f64104c8b6ca0cdb2d3661d0ac5e6155ac13903..ad935ce41479bc44c1a798ed2821eefedf08e93b 100644 (file)
@@ -214,22 +214,24 @@ function config_init(uci)
        }
 
        for (let name, data in sections.station) {
-               if (!data.iface || !vifs[data.iface])
-                       continue;
-
-               for (let vif in vifs[data.iface]) {
-                       let dev = devices[vif.device];
-                       let handler = handlers[vif.device];
-                       if (!dev || !handler)
+               for (let iface, iface_vifs in vifs) {
+                       if (data.iface && data.iface != iface)
                                continue;
 
-                       let config = parse_attribute_list(data, handler.station);
+                       for (let vif in iface_vifs) {
+                               let dev = devices[vif.device];
+                               let handler = handlers[vif.device];
+                               if (!dev || !handler)
+                                       continue;
 
-                       let sta = {
-                               name,
-                               config
-                       };
-                       push(vif.sta, sta);
+                               let config = parse_attribute_list(data, handler.station);
+
+                               let sta = {
+                                       name,
+                                       config
+                               };
+                               push(vif.sta, sta);
+                       }
                }
        }