summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wireguard.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 19:59:17 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:40 +0200
commit56caf9cc1e980f5b2e03b930a5411a94190fbba7 (patch)
treefe6646dbd03374a4f9d4f189afacf0b3e48ac295 /src/conf_mode/interfaces-wireguard.py
parent4efdaa11523d4fed36f2ea73bd1aed4c4186faa7 (diff)
downloadvyos-1x-56caf9cc1e980f5b2e03b930a5411a94190fbba7.tar.gz
vyos-1x-56caf9cc1e980f5b2e03b930a5411a94190fbba7.zip
wireguard: T2241: make address and bridge membership mutually exclusive
Bridge members should not have any addresses assigned.
Diffstat (limited to 'src/conf_mode/interfaces-wireguard.py')
-rwxr-xr-xsrc/conf_mode/interfaces-wireguard.py5
1 files changed, 5 insertions, 0 deletions
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')