From: Tobias Waldvogel Date: Thu, 14 Aug 2025 08:09:58 +0000 (+0200) Subject: wifi-scripts: iface should be optional in wifi-vlan definition X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98435a37a7139aa4bc1d494f7cc3cbdf2b9be597;p=thirdparty%2Fopenwrt.git 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 --- 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 f0dc762e19a..2103c9c3691 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); + } } }