control/controlclient: accept key if last seen on exist node is absent (#19402)

On some nodes (found via natlab), the existing nodes last seen could be
unset. For these cases, we would want to accept the key and write a last
seen. This was breaking the cached netmap natlab tests.

Updates #12639

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
Claus Lensbøl
2026-04-15 03:53:40 -04:00
committed by GitHub
parent effbe67fe3
commit 61c95f409c
3 changed files with 20 additions and 5 deletions
+3 -2
View File
@@ -459,8 +459,9 @@ func (ms *mapSession) removeUnwantedDiscoUpdates(resp *tailcfg.MapResponse, viaT
}
// Accept if:
// - lastSeen moved forward in time.
if existingLastSeen, ok := existingNode.LastSeen().GetOk(); ok &&
// - if we don't have a last seen to compare against on the existing node.
// - OR lastSeen moved forward in time.
if existingLastSeen, ok := existingNode.LastSeen().GetOk(); !ok ||
change.LastSeen.After(existingLastSeen) {
acceptedDiscoUpdates = append(acceptedDiscoUpdates, change)
}