mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-26 22:39:07 +01:00
Prevent double start the guard code
This commit is contained in:
@@ -807,7 +807,12 @@ func (conn *Conn) rosenpassDetermKey() (*wgtypes.Key, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (conn *Conn) switchGuard() {
|
func (conn *Conn) switchGuard() {
|
||||||
|
if conn.guardCtxCancel == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
conn.guardCtxCancel()
|
conn.guardCtxCancel()
|
||||||
|
conn.guardCtxCancel = nil
|
||||||
conn.wgGuard.Wait()
|
conn.wgGuard.Wait()
|
||||||
conn.wg.Add(1)
|
conn.wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user