]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Fix infinite loop in exit routine
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 5 May 2018 03:33:29 +0000 (05:33 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sat, 5 May 2018 03:33:29 +0000 (05:33 +0200)
receive.go
send.go

index 1d8b71821f26e97609487bae1bb3385d6790ac0e..dc6488f9833da416eea593163d91625e58206c51 100644 (file)
@@ -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 7423e3b87274396c9e3128de3b99b014647cfe0b..7abe2117d1fade3388dfe74ae8699086540c5ee3 100644 (file)
--- 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")
        }()