-
[client] Index peer tunnel IPs for faster PeerStateByIP lookup (#6412)
Some checks failedRelease / FreeBSD Port / Build & Test (push) Has been cancelledRelease / release (push) Has been cancelledRelease / release_ui (push) Has been cancelledRelease / release_ui_darwin (push) Has been cancelledRelease / Windows Installer / Build Test (amd64, amd64) (push) Has been cancelledRelease / Windows Installer / Build Test (arm64, arm64) (push) Has been cancelledRelease / Comment release artifacts (push) Has been cancelledRelease / trigger_signer (push) Has been cancelledsync tag / trigger_sync_tag (push) Has been cancelledsync tag / trigger_android_bump (push) Has been cancelledsync tag / trigger_ios_bump (push) Has been cancelledupdate docs / trigger_docs_api_update (push) Has been cancelledreleased this
2026-06-12 16:24:15 +08:00 - [client] Index peer tunnel IPs for O(1) PeerStateByIP lookup
Replace the linear scan over all peers with an ipToKey map maintained
by AddPeer/RemovePeer, covering both IPv4 and IPv6 tunnel addresses.Offline peers are intentionally no longer resolvable by IP: only active
peers can carry traffic, so IdentityForIP and the DNS disconnected-peer
filter now treat them as unknown, same as foreign IPs.Skip the DNS answer filter for single-record responses; dropping the
only answer was always restored by the empty-answer escape hatch, so
the fast path is behavior-neutral.- Ensure
ipToKeyentries are only removed if they match the peer being deleted, preventing accidental removal of unrelated mappings.
Downloads