aboutsummaryrefslogtreecommitdiffstats
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
parentFix refactoring mistakes (diff)
downloadwireguard-go-cf161f270e208cbe36a400c12f194f1f353db31e.tar.xz
wireguard-go-cf161f270e208cbe36a400c12f194f1f353db31e.zip
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()