From 7b53550fe6fb11a5dce69ce61cee108c3607273a Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Wed, 29 Apr 2026 07:57:38 -0700 Subject: [PATCH] control/controlclient: fix a nil-indirection bug in DERP key pruning (#19565) Upon deciding to update the LastSeen timestamp, we weren't checking that the field we are replacing into was non-nil. Rather than add an additional check, just allocate a fresh pointer for the updated time. Updates #19564 Change-Id: I589ebe65175fc7677c04a31dd6c4670e2531ee62 Signed-off-by: M. J. Fromberger --- control/controlclient/map.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/control/controlclient/map.go b/control/controlclient/map.go index 01c685eb4..34b5ecc55 100644 --- a/control/controlclient/map.go +++ b/control/controlclient/map.go @@ -521,7 +521,11 @@ func (ms *mapSession) removeUnwantedDiscoUpdatesFromFullNetmapUpdate(resp *tailc // Overwrite the key and last seen in the full netmap update. peer.DiscoKey = existingNode.DiscoKey() - *peer.LastSeen = existingNode.LastSeen().Get() + if t, ok := existingNode.LastSeen().GetOk(); ok { + peer.LastSeen = new(t) + } else { + peer.LastSeen = nil + } } }