mirror of
https://github.com/tailscale/tailscale.git
synced 2026-07-15 01:53:08 -04:00
The engine kept its own longest-prefix-match table (peerByIPRoute), rebuilt from the full peer list on every reconfig, to route outbound packets and answer PeerKeyForIP. That's now the route manager's job: LocalBackend already installs a PeerByIPPacketFunc backed by the RouteManager's incrementally-maintained outbound table, so the engine's copy was redundant state with redundant O(n peers) rebuild work. Delete the table, the PeerKeyForIP interface method, and the BART-only default callback. LocalBackend's peerForIP now queries the RouteManager's outbound table directly for the subnet-route and exit-node fallback. Engines running without a LocalBackend (such as wgengine/bench) must install their own outbound peer lookup, since the device's standard AllowedIPs trie only covers peers that already exist and can't lazily create them. Updates #12542 Change-Id: I25100399e273ed6c2bb1f6136b7cd81bc83e7313 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>