From 63abb5537bef592fe65ec94801e10a7406314094 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 11 Nov 2021 03:11:29 +0100 Subject: device: do not consume handshake messages if not running Signed-off-by: Jason A. Donenfeld --- device/noise-protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/noise-protocol.go b/device/noise-protocol.go index 0212b7d..e31ceda 100644 --- a/device/noise-protocol.go +++ b/device/noise-protocol.go @@ -282,7 +282,7 @@ func (device *Device) ConsumeMessageInitiation(msg *MessageInitiation) *Peer { // lookup peer peer := device.LookupPeer(peerPK) - if peer == nil { + if peer == nil || !peer.isRunning.Get() { return nil } -- cgit v1.2.3