summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-03-14 23:43:51 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2017-03-14 23:43:51 -0700
commitec16dc7aa9ad5bac59f0c8136d89cf475c2c5b88 (patch)
treeb7a60c0220d80757a254b29fd3244ea7b3f35ffc
parentcreate-patch: add context below to work with busybox patch (diff)
downloadwireguard-monolithic-historical-ec16dc7aa9ad5bac59f0c8136d89cf475c2c5b88.tar.xz
wireguard-monolithic-historical-ec16dc7aa9ad5bac59f0c8136d89cf475c2c5b88.zip
timers: elide enable check
-rw-r--r--src/timers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timers.c b/src/timers.c
index 41a9d3a..4fd9ec8 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -6,7 +6,7 @@
#include "packets.h"
/*
- * Timer for retransmitting the handshake if we don't hear back after `REKEY_TIMEOUT` ms
+ * Timer for retransmitting the handshake if we don't hear back after `REKEY_TIMEOUT + jitter` ms
* Timer for sending empty packet if we have received a packet but after have not sent one for `KEEPALIVE_TIMEOUT` ms
* Timer for initiating new handshake if we have sent a packet but after have not received one (even empty) for `(KEEPALIVE_TIMEOUT + REKEY_TIMEOUT)` ms
* Timer for zeroing out all ephemeral keys after `(REJECT_AFTER_TIME * 3)` ms if no new keys have been received
@@ -123,10 +123,10 @@ void timers_any_authenticated_packet_received(struct wireguard_peer *peer)
/* Should be called after a handshake initiation message is sent. */
void timers_handshake_initiated(struct wireguard_peer *peer)
{
- if (likely(peer->timers_enabled))
+ if (likely(peer->timers_enabled)) {
del_timer(&peer->timer_send_keepalive);
- if (likely(peer->timers_enabled))
mod_timer(&peer->timer_retransmit_handshake, slack_time(jiffies + REKEY_TIMEOUT + prandom_u32_max(REKEY_TIMEOUT_JITTER_MAX)));
+ }
}
/* Should be called after a handshake response message is received and processed. */