summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 20:01:54 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:40 +0200
commit366a53072f40f9ffbf05800787dc7faef5e489e2 (patch)
tree5c6d7e15a2e72f83ecb11be7fdeac66603240587
parent8bdbf5fa8bf4a0134d373412bfca0a562c615a5d (diff)
downloadvyos-1x-366a53072f40f9ffbf05800787dc7faef5e489e2.tar.gz
vyos-1x-366a53072f40f9ffbf05800787dc7faef5e489e2.zip
wireless: T2241: make VRF and bridge membership mutually exclusive
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index 04125ff31..319685fbd 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -599,9 +599,15 @@ def verify(wifi):
if not radius['key']:
raise ConfigError('Misssing RADIUS shared secret key for server: {}'.format(radius['server']))
- vrf_name = wifi['vrf']
- if vrf_name and vrf_name not in interfaces():
- raise ConfigError(f'VRF "{vrf_name}" does not exist')
+ if wifi['vrf']:
+ if wifi['vrf'] not in interfaces():
+ raise ConfigError(f'VRF "{wifi["vrf"]}" does not exist')
+
+ if wifi['is_bridge_member']:
+ raise ConfigError((
+ f'Interface "{wifi["intf"]}" cannot be member of VRF '
+ f'"{wifi["vrf"]}" and bridge {wifi["is_bridge_member"]} '
+ f'at the same time!'))
# use common function to verify VLAN configuration
verify_vlan_config(wifi)