Merge pull request #1276 from WGDashboard/#1257-fix

#1257 fix
This commit is contained in:
Donald Zou
2026-05-10 13:33:05 +08:00
committed by GitHub

View File

@@ -1317,11 +1317,11 @@ def API_ping_getAllPeersIpAddress():
for x in allowed_ip:
try:
ip = ipaddress.ip_network(x, strict=False)
if ip.num_addresses == 1:
parsed.append(str(ip.network_address))
except ValueError as e:
app.logger.error(f"Failed to parse IP address of {p.id} - {c.Name}")
host = list(ip.hosts())
if len(host) == 1:
parsed.append(str(host[0]))
endpoint = p.endpoint.replace(" ", "").replace("(none)", "")
if len(p.name) > 0:
cips[f"{p.name} - {p.id}"] = {