From 5ac80802197e1b5c17db96580b004391bde47bf2 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Fri, 1 May 2020 16:26:50 +0200 Subject: bonding: T2241: make VRF and bridge membership mutually exclusive --- src/conf_mode/interfaces-bonding.py | 12 +++++++++--- 1 file 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) -- cgit v1.2.3