summaryrefslogtreecommitdiffstats
path: root/device/receive.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-02-09 19:26:45 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-09 19:26:45 +0100
commitda32fe328bb2958773b07280c62eaebb6857f4df (patch)
tree6e900580cc61e74f7d60dc8b9136dba8a62c7e96 /device/receive.go
parentdevice: make RoutineReadFromTUN keep encryption queue alive (diff)
downloadwireguard-go-da32fe328bb2958773b07280c62eaebb6857f4df.tar.xz
wireguard-go-da32fe328bb2958773b07280c62eaebb6857f4df.zip
device: handshake routine writes into encryption queue
Since RoutineHandshake calls peer.SendKeepalive(), it potentially is a writer into the encryption queue, so we need to bump the wg count. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/receive.go')
-rw-r--r--device/receive.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/device/receive.go b/device/receive.go
index 3fc6831..6b9cccd 100644
--- a/device/receive.go
+++ b/device/receive.go
@@ -237,7 +237,10 @@ func (device *Device) RoutineDecryption() {
/* Handles incoming packets related to handshake
*/
func (device *Device) RoutineHandshake() {
- defer device.log.Verbosef("Routine: handshake worker - stopped")
+ defer func() {
+ device.log.Verbosef("Routine: handshake worker - stopped")
+ device.queue.encryption.wg.Done()
+ }()
device.log.Verbosef("Routine: handshake worker - started")
for elem := range device.queue.handshake.c {