mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-04 19:56:35 +02:00
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 <fromberger@tailscale.com>
This commit is contained in:
parent
a29e42135b
commit
7b53550fe6
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user