From 482f342d2515a46c2040b06e7b27e0a7dd8c2a9e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 17 Mar 2021 10:45:04 +0100 Subject: [PATCH] luci-mod-network: allow wifi bridging with bridge or bridge vlan ifaces Recent netifd automatically adds wireless devices as bridge ports if the layer 2 device referenced by the "config interface" target network is a Linux network bridge or a VLAN interface on top of a network bridge. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 3b4c161e01e2bd19105c123fbec463bc069d637b) --- .../luci-static/resources/view/network/wireless.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index c8a8e5c213..748cb6254f 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -987,8 +987,17 @@ return view.extend({ return net || network.addNetwork(name, { proto: 'none' }); }, this, values[i])).then(L.bind(function(dev, net) { if (net) { - if (!net.isEmpty()) - net.set('type', 'bridge'); + if (!net.isEmpty()) { + var target_dev = net.getDevice(); + + /* Resolve parent interface of vlan */ + while (target_dev && target_dev.getType() == 'vlan') + target_dev = target_dev.getParent(); + + if (!target_dev || target_dev.getType() != 'bridge') + net.set('type', 'bridge'); + } + net.addDevice(dev); } }, this, dev))); -- 2.30.2