summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 16:26:50 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commit5ac80802197e1b5c17db96580b004391bde47bf2 (patch)
tree2e1f8000dbf83af86d0d94a8e95c47e7a1a617d0 /src/conf_mode
parentfaa490ad122eeb1de02947bb4593539f0f476bd3 (diff)
downloadvyos-1x-5ac80802197e1b5c17db96580b004391bde47bf2.tar.gz
vyos-1x-5ac80802197e1b5c17db96580b004391bde47bf2.zip
bonding: T2241: make VRF and bridge membership mutually exclusive
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-bonding.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py
index 0fc8cfa6c..7681a8c71 100755
--- a/src/conf_mode/interfaces-bonding.py
+++ b/src/conf_mode/interfaces-bonding.py
@@ -184,9 +184,15 @@ def verify(bond):
raise ConfigError('Mode dependency failed, primary not supported ' \
'in mode "{}"!'.format(bond['mode']))
- vrf_name = bond['vrf']
- if vrf_name and vrf_name not in interfaces():
- raise ConfigError(f'VRF "{vrf_name}" does not exist')
+ if bond['vrf']:
+ if bond['vrf'] not in interfaces():
+ raise ConfigError(f'VRF "{bond["vrf"]}" does not exist')
+
+ if bond['is_bridge_member']:
+ raise ConfigError((
+ f'Interface "{bond["intf"]}" cannot be member of VRF '
+ f'"{bond["vrf"]}" and bridge {bond["is_bridge_member"]} '
+ f'at the same time!'))
# use common function to verify VLAN configuration
verify_vlan_config(bond)