Fix seed_tailscale_peers to use CurAddr field not Endpoints
tailscale status --json uses CurAddr for the active direct endpoint, not Endpoints (which is always null/absent). Without this fix the Tailscale exclusion set was always empty.
This commit is contained in:
@@ -856,8 +856,10 @@ def seed_tailscale_peers() -> None:
|
|||||||
status = json.loads(result.stdout)
|
status = json.loads(result.stdout)
|
||||||
peer_ips = set()
|
peer_ips = set()
|
||||||
for peer in status.get('Peer', {}).values():
|
for peer in status.get('Peer', {}).values():
|
||||||
for ep in peer.get('Endpoints', []):
|
# CurAddr is the active direct endpoint (e.g. "10.0.0.0:41641")
|
||||||
ip = ep.split(':')[0]
|
cur = peer.get('CurAddr', '')
|
||||||
|
if cur:
|
||||||
|
ip = cur.rsplit(':', 1)[0]
|
||||||
if ip:
|
if ip:
|
||||||
peer_ips.add(ip)
|
peer_ips.add(ip)
|
||||||
if not peer_ips:
|
if not peer_ips:
|
||||||
|
|||||||
Reference in New Issue
Block a user