summaryrefslogtreecommitdiffhomepage
path: root/send.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-15 13:29:52 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-15 13:29:52 +0200
commitcf161f270e208cbe36a400c12f194f1f353db31e (patch)
tree78c283df2039cb57728da4ab14d999f4f2272f00 /send.go
parent27091c32841bf074bec60f46fea1954c455233d9 (diff)
Do not send keepalive if closed
Diffstat (limited to 'send.go')
-rw-r--r--send.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/send.go b/send.go
index a670c4d..9a59abd 100644
--- a/send.go
+++ b/send.go
@@ -107,7 +107,7 @@ func addToEncryptionQueue(
/* Queues a keepalive if no packets are queued for peer
*/
func (peer *Peer) SendKeepalive() bool {
- if len(peer.queue.nonce) != 0 || peer.queue.packetInNonceQueueIsAwaitingKey {
+ if len(peer.queue.nonce) != 0 || peer.queue.packetInNonceQueueIsAwaitingKey || !peer.isRunning.Get() {
return false
}
elem := peer.device.NewOutboundElement()