summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-11-11 03:11:29 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-11-15 23:40:47 +0100
commit63abb5537bef592fe65ec94801e10a7406314094 (patch)
tree37d769daa82c60a35241b61e41fac852ef4bdb7b
parent851efb1bb65555e0f765a3361c8eb5ac47435b19 (diff)
device: do not consume handshake messages if not running
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--device/noise-protocol.go2
1 files changed, 1 insertions, 1 deletions
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
}