summaryrefslogtreecommitdiffstatshomepage
path: root/src/device.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-29 14:33:06 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-29 14:34:27 +0100
commitfcf568e0de752dac0f9019610d18137915ad44d0 (patch)
tree80a70d667d7a9942ddc0136f1ab4494fe0de71ef /src/device.c
parentcompat: fix 3.10 backport (diff)
downloadwireguard-monolithic-historical-fcf568e0de752dac0f9019610d18137915ad44d0.tar.xz
wireguard-monolithic-historical-fcf568e0de752dac0f9019610d18137915ad44d0.zip
device: clear last handshake timer on ifdown
Otherwise new handshakes might not occur immediately when the interface goes up and down. Also initialize peers to having a proper zeroed handshake jiffies.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index d585c56..d5dc93c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -102,6 +102,7 @@ static int stop(struct net_device *dev)
timers_stop(peer);
noise_handshake_clear(&peer->handshake);
noise_keypairs_clear(&peer->keypairs);
+ peer->last_sent_handshake = get_jiffies_64() - REKEY_TIMEOUT - HZ;
}
mutex_unlock(&wg->device_update_lock);
skb_queue_purge(&wg->incoming_handshakes);