summaryrefslogtreecommitdiff
path: root/src/conf_mode/service_https.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-05-28 15:39:35 +0100
committerGitHub <noreply@github.com>2026-05-28 15:39:35 +0100
commitcd619d4c355c9158497951231b1c993f8a7d26a9 (patch)
tree1f9f69080a79e48faae06c5efaa3a9073a1d147a /src/conf_mode/service_https.py
parentd4bb72161387132475e68c9186419f0384c28b32 (diff)
parent18e14cf71b3597112357b58e24fbe7aa9a7d7f4c (diff)
downloadvyos-1x-cd619d4c355c9158497951231b1c993f8a7d26a9.tar.gz
vyos-1x-cd619d4c355c9158497951231b1c993f8a7d26a9.zip
Merge pull request #5109 from statio/fix/vrf-aware-port-check
T8454: fix VRF-bind port availability check in service_https
Diffstat (limited to 'src/conf_mode/service_https.py')
-rwxr-xr-xsrc/conf_mode/service_https.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/conf_mode/service_https.py b/src/conf_mode/service_https.py
index 59fb90bd1..13a4930fd 100755
--- a/src/conf_mode/service_https.py
+++ b/src/conf_mode/service_https.py
@@ -113,12 +113,18 @@ def verify(https):
if 'listen_address' in https:
listen_address = https['listen_address']
- for address in listen_address:
- if not check_port_availability(address, port, 'tcp') and not is_listen_port_bind_service(port, 'nginx'):
- raise ConfigError(f'TCP port "{port}" is used by another service!')
-
verify_vrf(https)
+ vrf = https.get('vrf', None)
+ for address in listen_address:
+ if (not check_port_availability(address, port, 'tcp', vrf=vrf)
+ and not is_listen_port_bind_service(port, 'nginx')):
+ vrf_error_msg = ''
+ if vrf:
+ vrf_error_msg = f' in vrf "{vrf}"'
+ raise ConfigError(f'TCP port "{port}"{vrf_error_msg} is already ' \
+ 'used by another service!')
+
# Verify API server settings, if present
if 'api' in https:
keys = dict_search('api.keys.id', https)