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 <jo@mein.io>
(cherry picked from commit 3b4c161e01
)
This commit is contained in:
parent
470848fac9
commit
482f342d25
1 changed files with 11 additions and 2 deletions
|
@ -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)));
|
||||
|
|
Loading…
Reference in a new issue