properly support verbatim ipv6 addresses

This commit is contained in:
Jörg Thalheim
2024-10-10 16:32:14 +02:00
parent 1f15fbce9d
commit 973aef72d3
2 changed files with 10 additions and 0 deletions

View File

@@ -845,6 +845,10 @@ def parse_deployment_address(
meta = {}
parts = host.split("@")
user: str | None = None
# count the number of : in the hostname
if host.count(":") > 1 and not host.startswith("["):
msg = f"Invalid hostname: {host}. IPv6 addresses must be enclosed in brackets , e.g. [::1]"
raise ClanError(msg)
if len(parts) > 1:
user = parts[0]
hostname = parts[1]