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>
This commit is contained in:
parent
d1bf56d7f1
commit
3b4c161e01
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())
|
||||
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