summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wireguard.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-17 21:06:01 +0200
committerChristian Breunig <christian@breunig.cc>2023-08-17 21:22:50 +0200
commit113ed87c0aa9f6eebbc65545b336469b1ebcea84 (patch)
tree702ef2b62e45db114763f9f06c2d9c908e6f614a /src/conf_mode/interfaces-wireguard.py
parent0d54be778ba2bf1c918c43a525d7ef878a1cb9ea (diff)
downloadvyos-1x-113ed87c0aa9f6eebbc65545b336469b1ebcea84.tar.gz
vyos-1x-113ed87c0aa9f6eebbc65545b336469b1ebcea84.zip
wireguard: T5409: rename threaded CLI not to per-client-thread
Using threaded as CLI node is a very deep term used by kernel threads. To make this more understandable to users, rename the node to per-client-thread. It's also not necessary to test if any one peer is configured and probing if the option is set. There is a base test which requires at least one peer to be configured.
Diffstat (limited to 'src/conf_mode/interfaces-wireguard.py')
-rwxr-xr-xsrc/conf_mode/interfaces-wireguard.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/conf_mode/interfaces-wireguard.py b/src/conf_mode/interfaces-wireguard.py
index ef0fdae15..c0f3f4d6e 100755
--- a/src/conf_mode/interfaces-wireguard.py
+++ b/src/conf_mode/interfaces-wireguard.py
@@ -90,7 +90,6 @@ def verify(wireguard):
# run checks on individual configured WireGuard peer
public_keys = []
- peer_enabled = False
for tmp in wireguard['peer']:
peer = wireguard['peer'][tmp]
@@ -107,18 +106,12 @@ def verify(wireguard):
if peer['public_key'] in public_keys:
raise ConfigError(f'Duplicate public-key defined on peer "{tmp}"')
- if 'disable' not in peer and is_wireguard_key_pair(wireguard['private_key'], peer['public_key']):
- raise ConfigError(f'Peer "{tmp}" has the same public key as the interface "{wireguard["ifname"]}"')
-
if 'disable' not in peer:
- peer_enabled = True
+ if is_wireguard_key_pair(wireguard['private_key'], peer['public_key']):
+ raise ConfigError(f'Peer "{tmp}" has the same public key as the interface "{wireguard["ifname"]}"')
public_keys.append(peer['public_key'])
- #Threaded can be enabled only if one enabled peer exists.
- if not peer_enabled and 'threaded' in wireguard:
- raise ConfigError(f'Set threaded on interface "{wireguard["ifname"]}" FAILED.\nNo enabled peers are configured')
-
def apply(wireguard):
tmp = WireGuardIf(wireguard['ifname'])
if 'deleted' in wireguard: