From: Jason A. Donenfeld Date: Sat, 5 May 2018 03:33:29 +0000 (+0200) Subject: Fix infinite loop in exit routine X-Git-Tag: 0.0.20180514~38^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09a9bc289990e3f377a331626b0102283d6f83f4;p=thirdparty%2Fwireguard-go.git Fix infinite loop in exit routine --- diff --git a/receive.go b/receive.go index 1d8b718..dc6488f 100644 --- a/receive.go +++ b/receive.go @@ -245,9 +245,10 @@ func (device *Device) RoutineDecryption() { elem.Drop() } default: - break + goto out } } + out: logDebug.Println("Routine: decryption worker - stopped") }() logDebug.Println("Routine: decryption worker - started") @@ -317,9 +318,10 @@ func (device *Device) RoutineHandshake() { select { case <-device.queue.handshake: default: - return + goto out } } + out: logDebug.Println("Routine: handshake worker - stopped") }() diff --git a/send.go b/send.go index 7423e3b..7abe211 100644 --- a/send.go +++ b/send.go @@ -281,9 +281,10 @@ func (device *Device) RoutineEncryption() { elem.Drop() } default: - break + goto out } } + out: logDebug.Println("Routine: encryption worker - stopped") }()