mirror of
https://github.com/tailscale/tailscale.git
synced 2026-09-13 06:19:11 -04:00
Instead of accessing the key and string directly, put it behind a method to make it easier to use that as a proxy when we add multiple keys (control and TSMP origin). Instead of only updating a single origin for disco keys, teach peermap how to work with multiple disco key sources so a key can originate from either control or TSMP. This sets the work up for switching dynamically between disco keys later. As of this commit, the keys still arrive for the most part via the controlClient, but this commit sets us up for: - Switching dynamically between received keys. - Route TSMP keys directly into magicsock, not via controlClient. - Potentially revert controlClient to the state before any TSMP changes, making it single threaded. - Use switching keys as trigger for optimistic WG handshakes, instead of tearing down the full connection and setting it up again. Updates #20494 Signed-off-by: Claus Lensbøl <claus@tailscale.com>