• [client] Index peer tunnel IPs for faster PeerStateByIP lookup (#6412)
    Some checks failed
    Release / FreeBSD Port / Build & Test (push) Has been cancelled
    Release / release (push) Has been cancelled
    Release / release_ui (push) Has been cancelled
    Release / release_ui_darwin (push) Has been cancelled
    Release / Windows Installer / Build Test (amd64, amd64) (push) Has been cancelled
    Release / Windows Installer / Build Test (arm64, arm64) (push) Has been cancelled
    Release / Comment release artifacts (push) Has been cancelled
    Release / trigger_signer (push) Has been cancelled
    sync tag / trigger_sync_tag (push) Has been cancelled
    sync tag / trigger_android_bump (push) Has been cancelled
    sync tag / trigger_ios_bump (push) Has been cancelled
    update docs / trigger_docs_api_update (push) Has been cancelled

    rainysy released 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 ipToKey entries are only removed if they match the peer being deleted, preventing accidental removal of unrelated mappings.
    Downloads