]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Do not send keepalive if closed
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 15 May 2018 11:29:52 +0000 (13:29 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 15 May 2018 11:29:52 +0000 (13:29 +0200)
send.go

diff --git a/send.go b/send.go
index a670c4d1faada3724757444361423a8e848384bf..9a59abd8fbfe69dde54682c9acc5c3eb1acbae5a 100644 (file)
--- 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()