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() {