]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
device: remove device.state.stopping from RoutineHandshake
authorJosh Bleecher Snyder <josh@tailscale.com>
Wed, 3 Feb 2021 00:14:54 +0000 (16:14 -0800)
committerJosh Bleecher Snyder <josh@tailscale.com>
Mon, 8 Feb 2021 16:18:32 +0000 (08:18 -0800)
It is no longer necessary.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
device/device.go
device/receive.go

index a7838b5c2fe36dfe409d4b1e3d2c5a5b3ae19405..9ea7c2484a27a3e430d480a1c2af914bcaf25d01 100644 (file)
@@ -342,7 +342,6 @@ func NewDevice(tunDevice tun.Device, logger *Logger) *Device {
        for i := 0; i < cpus; i++ {
                go device.RoutineEncryption()
                go device.RoutineDecryption()
-               device.state.stopping.Add(1) // handshake
                go device.RoutineHandshake()
        }
 
index 3b0f36c8c20a9527954b1eef48daed1ea705def1..21d9dbca8556b46ff8ce91a8bba42968b919e64e 100644 (file)
@@ -240,10 +240,7 @@ func (device *Device) RoutineDecryption() {
 /* Handles incoming packets related to handshake
  */
 func (device *Device) RoutineHandshake() {
-       defer func() {
-               device.log.Verbosef("Routine: handshake worker - stopped")
-               device.state.stopping.Done()
-       }()
+       defer device.log.Verbosef("Routine: handshake worker - stopped")
        device.log.Verbosef("Routine: handshake worker - started")
 
        for elem := range device.queue.handshake.c {