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 /src/conf_mode | |
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 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/interfaces-bridge.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-bridge.py b/src/conf_mode/interfaces-bridge.py index 076bdb63e..7af3e3d7c 100755 --- a/src/conf_mode/interfaces-bridge.py +++ b/src/conf_mode/interfaces-bridge.py @@ -123,12 +123,12 @@ def get_config(config=None): # VLAN-aware bridge members must not have VLAN interface configuration if 'native_vlan' in interface_config: - if 'disable' not in interface_config['native_vlan']: - vlan_aware = True + vlan_aware = True if 'allowed_vlan' in interface_config: vlan_aware = True + if vlan_aware: tmp = has_vlan_subinterface_configured(conf,interface) if tmp: @@ -142,6 +142,8 @@ def verify(bridge): verify_dhcpv6(bridge) verify_vrf(bridge) + + vlan_aware = False if dict_search('member.interface', bridge): for interface, interface_config in bridge['member']['interface'].items(): @@ -168,6 +170,16 @@ def verify(bridge): if 'has_vlan' in interface_config: raise ConfigError(error_msg + 'it has an VLAN subinterface assigned!') + # VLAN-aware bridge members must not have VLAN interface configuration + if 'native_vlan' in interface_config: + vlan_aware = True + + if 'allowed_vlan' in interface_config: + vlan_aware = True + + if vlan_aware and 'wlan' in interface: + raise ConfigError(error_msg + 'VLAN aware cannot be set!') + if 'allowed_vlan' in interface_config: for vlan in interface_config['allowed_vlan']: if re.search('[0-9]{1,4}-[0-9]{1,4}', vlan): |