diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-06-06 17:16:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-06 17:16:30 +0200 |
commit | 1c57ed83b7838f4153f5b655c6a2b47bc12547ba (patch) | |
tree | 9a23511ac6cc841dace175d8654e1592e8f25d85 /python | |
parent | f6752de811ba8a553abd631427e7735b191c1f91 (diff) | |
parent | ac7ee2b36df23c3a4dd2be393132631556b6ef40 (diff) | |
download | vyos-1x-1c57ed83b7838f4153f5b655c6a2b47bc12547ba.tar.gz vyos-1x-1c57ed83b7838f4153f5b655c6a2b47bc12547ba.zip |
Merge pull request #3573 from talmakion/bugfix/T6401-2
vxlan: T6401: Avoid calling get_vxlan_vni_filter() unless we need it
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/ifconfig/vxlan.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/vxlan.py b/python/vyos/ifconfig/vxlan.py index bdb48e303..918aea202 100644 --- a/python/vyos/ifconfig/vxlan.py +++ b/python/vyos/ifconfig/vxlan.py @@ -138,10 +138,13 @@ class VXLANIf(Interface): raise ValueError('Value out of range') if 'vlan_to_vni_removed' in self.config: - cur_vni_filter = get_vxlan_vni_filter(self.ifname) + cur_vni_filter = None + if dict_search('parameters.vni_filter', self.config) != None: + cur_vni_filter = get_vxlan_vni_filter(self.ifname) + for vlan, vlan_config in self.config['vlan_to_vni_removed'].items(): # If VNI filtering is enabled, remove matching VNI filter - if dict_search('parameters.vni_filter', self.config) != None: + if cur_vni_filter != None: vni = vlan_config['vni'] if vni in cur_vni_filter: self._cmd(f'bridge vni delete dev {self.ifname} vni {vni}') |