]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: iface should be optional in wifi-vlan definition
authorTobias Waldvogel <tobias.waldvogel@gmail.com>
Thu, 14 Aug 2025 08:09:58 +0000 (10:09 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 14 Aug 2025 15:28:33 +0000 (17:28 +0200)
The option iface should be optional according to the description
of /etc/config/wireless in order to avoid repeating the definition
for each virtual interface.

Signed-off-by: Tobias Waldvogel <tobias.waldvogel@gmail.com>
package/network/config/wifi-scripts/files/lib/netifd/wireless.uc

index f0dc762e19ab9d425544065142a4dd092b9a724d..2103c9c3691a90e7f578b07a929407611b47bf4f 100644 (file)
@@ -143,22 +143,24 @@ function config_init(uci)
        }
 
        for (let name, data in sections.vlan) {
-               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.vlan);
+                       for (let vif in iface_vifs) {
+                               let dev = devices[vif.device];
+                               let handler = handlers[vif.device];
+                               if (!dev || !handler)
+                                       continue;
 
-                       let vlan = {
-                               name,
-                               config
-                       };
-                       push(vif.vlan, vlan);
+                               let config = parse_attribute_list(data, handler.vlan);
+
+                               let vlan = {
+                                       name,
+                                       config
+                               };
+                               push(vif.vlan, vlan);
+                       }
                }
        }