mirror of
https://github.com/tailscale/tailscale.git
synced 2026-09-13 14:29:49 -04:00
Previously, the new disco keys entering the client via TSMP was routed into controlClient to allow for deduplication and filtering of disco keys and avoid control overwriting an active TSMP learned key with a stale key. A system supporting multiple disco keys was introduced to allow these keys living side by side, along side a system for selecting an active egress key with a bias towards keys learned via TSMP. On ingress any known key is accepted. This PR makes the switch to key routing, by sending new TSMP learned disco keys directly into the userspace engine and in turn magicsock, removing the need for a full layer of deduplication in the controlClient. Additionally, the system that previously fully reconfigured clients on disco key updates coming from control is now using an optimistic handshake througha newly introduced wireguard-go method, ScheduleHandshakeOnUserSend implemented in: https://github.com/tailscale/wireguard-go/pull/81 What this PR does not do is revert the mapSession back to being single writer. Bringing the mapSession back to this state is desired, however to ensure the plumbing is done right and easier to reason about, that will be done in a separate PR. Updates #20590 Signed-off-by: Claus Lensbøl <claus@tailscale.com>