From 60104e000b121919c53cd11a4a554fd875bd8107 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 3 Jul 2026 11:29:57 +0200 Subject: [PATCH] Discriminate not updated from timeout handshakes --- client/internal/peer/wg_watcher.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/internal/peer/wg_watcher.go b/client/internal/peer/wg_watcher.go index e9e19334d..458fd1832 100644 --- a/client/internal/peer/wg_watcher.go +++ b/client/internal/peer/wg_watcher.go @@ -88,6 +88,7 @@ func (w *WGWatcher) periodicHandshakeCheck(ctx context.Context, onDisconnectedFn case <-timer.C: handshake, ok := w.handshakeCheck(lastHandshake) if !ok { + // early ctx cancel check return if ctx.Err() != nil { return } @@ -132,9 +133,9 @@ func (w *WGWatcher) handshakeCheck(lastHandshake time.Time) (*time.Time, bool) { w.log.Tracef("previous handshake, handshake: %v, %v", lastHandshake, handshake) - // the current know handshake did not change + // the current known handshake did not change if handshake.Equal(lastHandshake) { - w.log.Warnf("WireGuard handshake timed out: %v", handshake) + w.log.Warnf("WireGuard handshake not updated: %v", handshake) return nil, false }