device: do not consume handshake messages if not running

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2021-11-11 03:11:29 +01:00
parent 851efb1bb6
commit 63abb5537b

View File

@ -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
}