summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 20:05:17 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:40 +0200
commit2cb8062719280b9695b3e50c6cfa7c6997309bbc (patch)
tree9451cc935f83f325bca3cc7da237acf45f47d21e
parentab478417b027ca650563552c11af97742930a451 (diff)
downloadvyos-1x-2cb8062719280b9695b3e50c6cfa7c6997309bbc.tar.gz
vyos-1x-2cb8062719280b9695b3e50c6cfa7c6997309bbc.zip
wirelessmodem: T2241: make VRF and bond/bridge membership mutually exclusive
-rwxr-xr-xsrc/conf_mode/interfaces-wirelessmodem.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py
index 03832f345..2e25c33a9 100755
--- a/src/conf_mode/interfaces-wirelessmodem.py
+++ b/src/conf_mode/interfaces-wirelessmodem.py
@@ -134,9 +134,15 @@ def verify(wwan):
if not os.path.exists(f"/dev/{wwan['device']}"):
raise ConfigError(f"Device {wwan['device']} does not exist")
- vrf_name = wwan['vrf']
- if vrf_name and vrf_name not in interfaces():
- raise ConfigError(f'VRF {vrf_name} does not exist')
+ if wwan['vrf']:
+ if wwan['vrf'] not in interfaces():
+ raise ConfigError(f'VRF "{wwan["vrf"]}" does not exist')
+
+ if wwan['is_bridge_member']:
+ raise ConfigError((
+ f'Interface "{wwan["intf"]}" cannot be member of VRF '
+ f'"{wwan["vrf"]}" and bridge {wwan["is_bridge_member"]} '
+ f'at the same time!'))
return None