aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/timers.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-05-31 05:01:07 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-05-31 14:23:13 +0200
commit4061a818b2af5a4522eedf46b4e756e1a785f79c (patch)
tree60be4f25805303c0e00bb45941a9c7e381dfbd74 /src/timers.c
parenttimers: rework handshake reply control flow (diff)
downloadwireguard-linux-compat-4061a818b2af5a4522eedf46b4e756e1a785f79c.tar.xz
wireguard-linux-compat-4061a818b2af5a4522eedf46b4e756e1a785f79c.zip
timers: the completion of a handshake also is on key confirmation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.c')
-rw-r--r--src/timers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/timers.c b/src/timers.c
index a8cd537..209fe5a 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -130,12 +130,13 @@ void timers_handshake_initiated(struct wireguard_peer *peer)
}
}
-/* Should be called after a handshake response message is received and processed. */
+/* Should be called after a handshake response message is received and processed or when getting key confirmation via the first data message. */
void timers_handshake_complete(struct wireguard_peer *peer)
{
if (likely(peer->timers_enabled))
del_timer(&peer->timer_retransmit_handshake);
peer->timer_handshake_attempts = 0;
+ do_gettimeofday(&peer->walltime_last_handshake);
}
/* Should be called after an ephemeral key is created, which is before sending a handshake response or after receiving a handshake response. */
@@ -143,7 +144,6 @@ void timers_ephemeral_key_created(struct wireguard_peer *peer)
{
if (likely(peer->timers_enabled))
mod_timer(&peer->timer_kill_ephemerals, jiffies + (REJECT_AFTER_TIME * 3));
- do_gettimeofday(&peer->walltime_last_handshake);
}
/* Should be called before a packet with authentication -- data, keepalive, either handshake -- is sent, or after one is received. */