From d666d28e2e9a3456e3cb5cd6362ba5d83f1efdd8 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Fri, 10 Jul 2026 17:51:22 +0300 Subject: 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. --- src/conf_mode/interfaces_wireguard.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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 ' -- cgit v1.2.3