diff options
| author | Daniil Baturin <daniil@vyos.io> | 2025-04-22 15:50:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-22 15:50:34 +0100 |
| commit | be0ce3a33d717fe06bc52fe1f30a544a62ae5552 (patch) | |
| tree | f9aba30863ef33b4ce607cdada31101118412984 /python/vyos/configdict.py | |
| parent | 35e3a3722b5f420384e6d4a3fbf140210815f65c (diff) | |
| parent | 1d636f4c3779f4b5b08ccb1643dd80bc86c10fbf (diff) | |
| download | veeos-1x-be0ce3a33d717fe06bc52fe1f30a544a62ae5552.tar.gz veeos-1x-be0ce3a33d717fe06bc52fe1f30a544a62ae5552.zip | |
Merge pull request #4444 from l0crian1/T7322-fix-allowed-vlan
bridge: T7322: fix slow performance of allowed vlan
Diffstat (limited to 'python/vyos/configdict.py')
| -rw-r--r-- | python/vyos/configdict.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 78b98a3eb..586ddf632 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -626,6 +626,23 @@ def get_vlan_ids(interface): return vlan_ids +def get_vlans_ids_and_range(interface): + vlan_ids = set() + + vlan_filter_status = json.loads(cmd(f'bridge -j -d vlan show dev {interface}')) + + if vlan_filter_status is not None: + for interface_status in vlan_filter_status: + for vlan_entry in interface_status.get("vlans", []): + start = vlan_entry["vlan"] + end = vlan_entry.get("vlanEnd") + if end: + vlan_ids.add(f"{start}-{end}") + else: + vlan_ids.add(str(start)) + + return vlan_ids + def get_accel_dict(config, base, chap_secrets, with_pki=False): """ Common utility function to retrieve and mangle the Accel-PPP configuration |
