From 9c75f58f3d8656e9e5394959a67b630f51f9dc98 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 2 Feb 2021 16:14:54 -0800 Subject: [PATCH] device: remove device.state.stopping from RoutineHandshake It is no longer necessary. Signed-off-by: Josh Bleecher Snyder --- device/device.go | 1 - device/receive.go | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/device/device.go b/device/device.go index a7838b5..9ea7c24 100644 --- a/device/device.go +++ b/device/device.go @@ -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() } diff --git a/device/receive.go b/device/receive.go index 3b0f36c..21d9dbc 100644 --- a/device/receive.go +++ b/device/receive.go @@ -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 {