diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-07-11 16:34:42 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-07-11 17:21:54 +0200 |
commit | 361df1f39aef70bb8ad8ab71f68e417685a53792 (patch) | |
tree | 35e6bdfdf629c45a0265a48bd9baa1c79d8dd6f1 /src/peer.c | |
parent | cb0804a5f0ea650a8ab4068058801d7f17917294 (diff) |
noise: immediately rekey all peers after changing device private key
Reported-by: Derrick Pallas <derrick@pallas.us>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -56,9 +56,7 @@ struct wg_peer *wg_peer_create(struct wg_device *wg, rwlock_init(&peer->endpoint_lock); kref_init(&peer->refcount); skb_queue_head_init(&peer->staged_packet_queue); - atomic64_set(&peer->last_sent_handshake, - ktime_get_coarse_boottime_ns() - - (u64)(REKEY_TIMEOUT + 1) * NSEC_PER_SEC); + wg_noise_reset_last_sent_handshake(&peer->last_sent_handshake); set_bit(NAPI_STATE_NO_BUSY_POLL, &peer->napi.state); netif_napi_add(wg->dev, &peer->napi, wg_packet_rx_poll, NAPI_POLL_WEIGHT); |