From 28f8007d0ffbd454de4b9485c63effd187a0a9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Mon, 6 Oct 2025 15:07:51 +0200 Subject: [PATCH] Prevent double start the guard code --- client/internal/peer/conn.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/internal/peer/conn.go b/client/internal/peer/conn.go index 8a84145b8..b58c0f106 100644 --- a/client/internal/peer/conn.go +++ b/client/internal/peer/conn.go @@ -807,7 +807,12 @@ func (conn *Conn) rosenpassDetermKey() (*wgtypes.Key, error) { } func (conn *Conn) switchGuard() { + if conn.guardCtxCancel == nil { + return + } + conn.guardCtxCancel() + conn.guardCtxCancel = nil conn.wgGuard.Wait() conn.wg.Add(1) go func() {