mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-06 23:36:34 +09:00
setControlClientStatusLocked dropped b.mu mid-function for TKA sync RPCs and then kept using state computed before the unlock, including for its startLocked and handleNetmapExpiry callers that assume b.mu is held throughout. Split it into two locked halves that share one ipn.Notify. Only SetControlClientStatus unlocks between them, and only when TKA actually needs a sync. Also make the TKA sync abandon its work if b.tka or the profile changes while b.mu is released for an RPC. Likewise, TailnetLockModify and TailnetLockSubmitRecoveryAUM now do their RPCs outside the locked section, and TailnetLockAffectedSigs no longer verifies control's response against a different profile's authority. Add a test for TailnetLockModify, which had none. This is prep for moving more of Tailnet Lock into its ./feature/tailnetlock directory. Updates #12614 Change-Id: I59f7cffc26877afe15cb0f0a6103ff943d9af74a Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>