diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-29 14:33:06 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-29 14:34:27 +0100 |
commit | e18fb977156f938d76a58906af47cbcd9a3702bb (patch) | |
tree | 7bae89656c1c8dc2e2b6546c3f8a6d41c43e4d7c /src/peer.c | |
parent | compat: fix 3.10 backport (diff) | |
download | wireguard-linux-compat-e18fb977156f938d76a58906af47cbcd9a3702bb.tar.xz wireguard-linux-compat-e18fb977156f938d76a58906af47cbcd9a3702bb.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.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -52,6 +52,7 @@ struct wireguard_peer *peer_create(struct wireguard_device *wg, const u8 public_ skb_queue_head_init(&peer->staged_packet_queue); list_add_tail(&peer->peer_list, &wg->peer_list); pubkey_hashtable_add(&wg->peer_hashtable, peer); + peer->last_sent_handshake = get_jiffies_64() - REKEY_TIMEOUT - HZ; pr_debug("%s: Peer %llu created\n", wg->dev->name, peer->internal_id); return peer; } |