From 3b4c161e01e2bd19105c123fbec463bc069d637b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 17 Mar 2021 10:45:04 +0100 Subject: 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 --- .../htdocs/luci-static/resources/view/network/wireless.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'modules/luci-mod-network/htdocs/luci-static/resources/view') 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))); -- cgit v1.2.3