From 140b9aad5c7c2540f8284d3affab628e23cd95d4 Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Mon, 23 Jan 2023 18:21:37 -0500 Subject: [PATCH] ipn/ipnlocal: fire expiry timer when the current node expires The current node isn't in NetMap.Peers, so without this we would not have fired this timer on self expiry. Updates #6932 Signed-off-by: Andrew Dunham Change-Id: Id57f96985397e372f9226802d63b42ff92c95093 --- ipn/ipnlocal/local.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 265d1889d..4bc905d55 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -852,6 +852,13 @@ func (b *LocalBackend) setClientStatus(st controlclient.Status) { } } + // Ensure that we also fire this timer if our own node key expires. + if st.NetMap.SelfNode != nil { + if selfExpiry := st.NetMap.SelfNode.KeyExpiry; !selfExpiry.IsZero() && selfExpiry.Before(nextExpiry) { + nextExpiry = selfExpiry + } + } + if !nextExpiry.IsZero() { tmrDuration := nextExpiry.Sub(now) + 10*time.Second b.nmExpiryTimer = time.AfterFunc(tmrDuration, func() {