1
0
mirror of https://github.com/juanfont/headscale.git synced 2026-02-07 20:04:00 +01:00

When tailscaled restarts and sends Auth=nil, Expiry=zero, tagged nodes will correctly return early without being routed into handleLogout and

having their expiry corrupted.
This commit is contained in:
Samuel Batista 2026-02-07 02:16:54 -05:00 committed by GitHub
parent 9fd3d44a51
commit d87afe6f4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,7 +73,10 @@ func (h *Headscale) handleRegister(
// When tailscaled restarts, it sends RegisterRequest with Auth=nil and Expiry=zero.
// Return the current node state without modification.
// See: https://github.com/juanfont/headscale/issues/2862
if req.Expiry.IsZero() && node.Expiry().Valid() && !node.IsExpired() {
// Note: node.Expiry().Valid() was too strict — tagged nodes have nil expiry,
// which caused zero-time requests to fall through to handleLogout and
// incorrectly set their expiry to 0001-01-01 (Go zero time).
if req.Expiry.IsZero() && !node.IsExpired() {
return nodeToRegisterResponse(node), nil
}