summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2026-07-10 17:51:22 +0300
committerNataliia Solomko <natalirs1985@gmail.com>2026-07-10 17:51:22 +0300
commitd666d28e2e9a3456e3cb5cd6362ba5d83f1efdd8 (patch)
treea1a707f56634cb271e81d5dd34d4b4a41bbd193f /src
parent43dfe32914fc5dcb09d8fb6e59045e18f2d1d708 (diff)
downloadvyos-1x-d666d28e2e9a3456e3cb5cd6362ba5d83f1efdd8.tar.gz
vyos-1x-d666d28e2e9a3456e3cb5cd6362ba5d83f1efdd8.zip
wireguard: T8921: Fix false port-conflict error on qos dependent re-verify
qos.py re-invokes this script mid-commit after the interface has already bound its port, causing the port-availability check to fail against itself and drop the whole QoS config. This can happen on any commit that sets or changes the port. Skip the check on that dependent re-run only.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_wireguard.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces_wireguard.py b/src/conf_mode/interfaces_wireguard.py
index 44ee70d27..850c66a29 100755
--- a/src/conf_mode/interfaces_wireguard.py
+++ b/src/conf_mode/interfaces_wireguard.py
@@ -26,6 +26,7 @@ from vyos.configdict import is_vrf_changed
from vyos.configdict import is_source_interface
from vyos.configdep import set_dependents
from vyos.configdep import call_dependents
+from vyos.configdep import called_as_dependent
from vyos.configverify import verify_vrf
from vyos.configverify import verify_address
from vyos.configverify import verify_bridge_delete
@@ -114,7 +115,14 @@ def verify(wireguard):
if 'private_key' not in wireguard:
raise ConfigError('Wireguard private-key not defined')
- if 'port' in wireguard and 'port_changed' in wireguard:
+ # T8921: Skip the port-availability check on a qos.py-triggered
+ # dependent re-run: by then this interface already holds the port
+ # itself, so the check would always false-positive as busy.
+ if (
+ 'port' in wireguard
+ and 'port_changed' in wireguard
+ and not called_as_dependent()
+ ):
listen_port = int(wireguard['port'])
if check_port_availability(None, listen_port, protocol='udp') is not True:
raise ConfigError(f'UDP port {listen_port} is busy or unavailable and '