From 56caf9cc1e980f5b2e03b930a5411a94190fbba7 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Fri, 1 May 2020 19:59:17 +0200 Subject: wireguard: T2241: make address and bridge membership mutually exclusive Bridge members should not have any addresses assigned. --- src/conf_mode/interfaces-wireguard.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/conf_mode/interfaces-wireguard.py b/src/conf_mode/interfaces-wireguard.py index 3fb527401..3b18f8a15 100755 --- a/src/conf_mode/interfaces-wireguard.py +++ b/src/conf_mode/interfaces-wireguard.py @@ -200,6 +200,11 @@ def verify(wg): return None + if wg['is_bridge_member'] and wg['address']: + raise ConfigError(( + f'Cannot assign address to interface "{wg["intf"]}" ' + f'as it is a member of bridge "{wg["is_bridge_member"]}"!')) + if wg['vrf']: if wg['vrf'] not in interfaces(): raise ConfigError(f'VRF "{wg["vrf"]}" does not exist') -- cgit v1.2.3