diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-10-19 09:29:25 +0900 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-10-19 17:21:49 +0900 |
commit | 5a17573c776e5c4868177eceeaa4c794e0240502 (patch) | |
tree | 38982fbd15a5c2e2e57086117cfaa6026d464ac9 /src/timers.c | |
parent | timers: avoid thundering herd for simultaneous initiation (diff) | |
download | wireguard-monolithic-historical-5a17573c776e5c4868177eceeaa4c794e0240502.tar.xz wireguard-monolithic-historical-5a17573c776e5c4868177eceeaa4c794e0240502.zip |
timers: kill half-open handshakes after a while
Diffstat (limited to '')
-rw-r--r-- | src/timers.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/timers.c b/src/timers.c index c37b294..f85054b 100644 --- a/src/timers.c +++ b/src/timers.c @@ -34,6 +34,10 @@ static void expired_retransmit_handshake(unsigned long ptr) /* We remove all existing packets and don't try again, * if we try unsuccessfully for too long to make a handshake. */ skb_queue_purge(&peer->tx_packet_queue); + /* We set a timer for destroying any residue that might be left + * of a partial exchange. */ + if (likely(peer->timer_kill_ephemerals.data)) + mod_timer(&peer->timer_kill_ephemerals, jiffies + (REJECT_AFTER_TIME * 3)); return; } packet_queue_send_handshake_initiation(peer); |