mirror of
https://github.com/tailscale/tailscale.git
synced 2026-04-02 04:01:30 +02:00
The node key generated in doLogin was only written to persistent storage after a successful HTTP response. If the process was killed mid-request, the key was lost and a fresh one generated on restart, causing each restart to look like a new node to the control server. Add a PersistState callback on Direct.Options that writes the new key directly to the state store before the HTTP POST. On restart the existing key is reused, turning N restarts into N retries of the same registration instead of N new registrations. Fixes #19149 Signed-off-by: Raj Singh <raj@tailscale.com>