summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient/map.go
diff options
context:
space:
mode:
authorClaus Lensbøl <claus@tailscale.com>2026-04-15 03:53:40 -0400
committerGitHub <noreply@github.com>2026-04-15 03:53:40 -0400
commit61c95f409c90728d3c3ad2627ea77fa4e1a48390 (patch)
treee6b957e9a590f1c5012a719852cf04b3779b8f75 /control/controlclient/map.go
parenteffbe67fe3e30f48bd4b159ca9d37b1afea6052a (diff)
downloadtailscale-61c95f409c90728d3c3ad2627ea77fa4e1a48390.tar.xz
tailscale-61c95f409c90728d3c3ad2627ea77fa4e1a48390.zip
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>
Diffstat (limited to 'control/controlclient/map.go')
-rw-r--r--control/controlclient/map.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/control/controlclient/map.go b/control/controlclient/map.go
index 84a7c2e8b..17c223fe3 100644
--- a/control/controlclient/map.go
+++ b/control/controlclient/map.go
@@ -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)
}