diff options
author | JACK <jack9603301@163.com> | 2020-11-20 03:54:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 20:54:09 +0100 |
commit | f01b0ae9e5e71c55d5ea46103b59f265fd6b6f52 (patch) | |
tree | b099d72a86bbf00a504b747ea2d578e039afaec1 /python/vyos | |
parent | f00985ccc246194a248c8ccbbc4a9fbc6093e3e7 (diff) | |
download | vyos-1x-f01b0ae9e5e71c55d5ea46103b59f265fd6b6f52.tar.gz vyos-1x-f01b0ae9e5e71c55d5ea46103b59f265fd6b6f52.zip |
bridge: T3067: Fix VLAN aware setting failure under WLAN (#613)
In the implementation of T3042, it will cause two problems:
1. Even if VLAN awareness is not enabled, the VLAN settings of the
vlan filter will be modified. When the bridge member has a WLAN interface,
the error is exposed, so repair it here. You should not modify the
related settings when the VLAN awareness mode is not enabled
2. Even if VLAN awareness is not enabled, the VLAN settings of the
vlan filter will be modified. When the bridge member has a WLAN interface,
due to special settings, the bridge mode cannot be entered and the settings
cannot be completed directly. Therefore, the WLAN interface should be rejected
Enter the bridge with VLAN awareness
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ifconfig/bridge.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py index 7c77e050a..e6cda4adb 100644 --- a/python/vyos/ifconfig/bridge.py +++ b/python/vyos/ifconfig/bridge.py @@ -309,15 +309,12 @@ class BridgeIf(Interface): vlan_filter = 1 cmd = f'bridge vlan del dev {interface} vid 1' self._cmd(cmd) - vlan_del.add(1) vlan_id = interface_config['native_vlan'] + if vlan_id != 1: + vlan_del.add(1) cmd = f'bridge vlan add dev {interface} vid {vlan_id} pvid untagged master' self._cmd(cmd) vlan_add.add(vlan_id) - else: - cmd = f'bridge vlan del dev {interface} vid 1' - self._cmd(cmd) - vlan_del.add(1) if 'allowed_vlan' in interface_config: vlan_filter = 1 @@ -325,6 +322,11 @@ class BridgeIf(Interface): 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) for vlan in vlan_del: |