[openwrt/openwrt] wifi-scripts: iface should be optional in wifi-vlan definition

LEDE Commits lede-commits at lists.infradead.org
Thu Aug 14 08:28:41 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/98435a37a7139aa4bc1d494f7cc3cbdf2b9be597

commit 98435a37a7139aa4bc1d494f7cc3cbdf2b9be597
Author: Tobias Waldvogel <tobias.waldvogel at gmail.com>
AuthorDate: Thu Aug 14 10:09:58 2025 +0200

    wifi-scripts: iface should be optional in wifi-vlan definition
    
    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 at gmail.com>
---
 .../wifi-scripts/files/lib/netifd/wireless.uc      | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
index f0dc762e19..2103c9c369 100644
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
@@ -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);
+			}
 		}
 	}
 




More information about the lede-commits mailing list