mirror of
https://github.com/outbackdingo/wlan-ap.git
synced 2026-01-27 10:20:52 +00:00
udevstats: fix adding the same vlans to the config
Add filtering the same vlans before adding to the vlan config. The issue was detected during connection many WiFi client using dynamic vlans on the network. Fixes: WIFI-13538 Signed-off-by: Marek Kwaczynski <marek@shasta.cloud>
This commit is contained in:
@@ -129,6 +129,21 @@ function vlan_add(dev, vid, ad)
|
||||
vlans[keystr] = true;
|
||||
}
|
||||
|
||||
function vlan_config_push(vlan_config, dev, vid)
|
||||
{
|
||||
let vlan_found = false;
|
||||
|
||||
for (let v in vlan_config[dev]) {
|
||||
if (v[0] == vid) {
|
||||
vlan_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!vlan_found)
|
||||
push(vlan_config[dev], [ vid, "rx", "tx"]);
|
||||
}
|
||||
|
||||
function vlan_set_config(config)
|
||||
{
|
||||
vlan_config = config;
|
||||
@@ -221,7 +236,7 @@ function run_service() {
|
||||
return ubus.STATUS_INVALID_ARGUMENT;
|
||||
if (!vlan_config[req.args.device])
|
||||
vlan_config[req.args.device] = [];
|
||||
push(vlan_config[req.args.device], [ req.args.vlan, "rx", "tx"]);
|
||||
vlan_config_push(vlan_config, req.args.device, req.args.vlan);
|
||||
vlan_set_config(vlan_config);
|
||||
return 0;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user