From 9998768f0c8edb3e72566f1d26bee67d42adc133 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sun, 3 May 2020 21:02:10 +0200 Subject: bonding: T2241: make address and bridge membership mutually exclusive Bridge members should not have addresses assigned. --- src/conf_mode/interfaces-bonding.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/conf_mode') diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py index ec9e0bb11..e5626ef6c 100755 --- a/src/conf_mode/interfaces-bonding.py +++ b/src/conf_mode/interfaces-bonding.py @@ -185,6 +185,14 @@ def verify(bond): raise ConfigError('Mode dependency failed, primary not supported ' \ 'in mode "{}"!'.format(bond['mode'])) + if ( bond['is_bridge_member'] + and ( bond['address'] + or bond['ipv6_eui64_prefix'] + or bond['ipv6_autoconf'] ) ): + raise ConfigError(( + f'Cannot assign address to interface "{bond["intf"]}" ' + f'as it is a member of bridge "{bond["is_bridge_member"]}"!')) + if bond['vrf']: if bond['vrf'] not in interfaces(): raise ConfigError(f'VRF "{bond["vrf"]}" does not exist') -- cgit v1.2.3