summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJACK <jack9603301@163.com>2020-11-21 16:25:08 +0800
committerGitHub <noreply@github.com>2020-11-21 09:25:08 +0100
commit9b8e3d83e9cf106e2203300e1d5b940f839c9827 (patch)
tree78718d20b986af115e1007cd758f10da6801474d
parent5b693c3a71f55062528ba93e934f27c8f9d611cf (diff)
downloadvyos-1x-9b8e3d83e9cf106e2203300e1d5b940f839c9827.tar.gz
vyos-1x-9b8e3d83e9cf106e2203300e1d5b940f839c9827.zip
bridge: T3079: bugfix on VLAN 1 is deleted in VLAN-aware bridges
-rw-r--r--python/vyos/ifconfig/bridge.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py
index e6cda4adb..1ecc2dd76 100644
--- a/python/vyos/ifconfig/bridge.py
+++ b/python/vyos/ifconfig/bridge.py
@@ -318,15 +318,19 @@ class BridgeIf(Interface):
if 'allowed_vlan' in interface_config:
vlan_filter = 1
- for vlan in interface_config['allowed_vlan']:
- cmd = f'bridge vlan add dev {interface} vid {vlan} master'
- self._cmd(cmd)
- vlan_add.add(vlan)
if vlan_filter:
if 'native_vlan' not in interface_config:
cmd = f'bridge vlan del dev {interface} vid 1'
self._cmd(cmd)
+
+ if 'allowed_vlan' in interface_config:
+ for vlan in interface_config['allowed_vlan']:
+ cmd = f'bridge vlan add dev {interface} vid {vlan} master'
+ self._cmd(cmd)
+ vlan_add.add(vlan)
+
+
for vlan in vlan_del: