diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-19 01:02:50 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-19 01:02:50 +0200 |
commit | 30290ef1d2581a3e6ee8ffcdb05d580cfba976be (patch) | |
tree | 4252b286da48b2209cf38beed638e678a93b6f11 /src/send.c | |
parent | timers: fix up comment (diff) | |
download | wireguard-monolithic-historical-30290ef1d2581a3e6ee8ffcdb05d580cfba976be.tar.xz wireguard-monolithic-historical-30290ef1d2581a3e6ee8ffcdb05d580cfba976be.zip |
timers: clear send_keepalive timer on sending handshake response
We reorganize this into also doing so on sending keepalives itself,
which means the state machine is much more consistent, even if this was
already implied.
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -36,6 +36,7 @@ static void packet_send_handshake_initiation(struct wireguard_peer *peer) if (noise_handshake_create_initiation(&packet, &peer->handshake)) { cookie_add_mac_to_packet(&packet, sizeof(packet), peer); timers_any_authenticated_packet_traversal(peer); + timers_any_authenticated_packet_sent(peer); socket_send_buffer_to_peer(peer, &packet, sizeof(struct message_handshake_initiation), HANDSHAKE_DSCP); timers_handshake_initiated(peer); } @@ -78,6 +79,7 @@ void packet_send_handshake_response(struct wireguard_peer *peer) if (noise_handshake_begin_session(&peer->handshake, &peer->keypairs)) { timers_session_derived(peer); timers_any_authenticated_packet_traversal(peer); + timers_any_authenticated_packet_sent(peer); socket_send_buffer_to_peer(peer, &packet, sizeof(struct message_handshake_response), HANDSHAKE_DSCP); } } @@ -200,6 +202,7 @@ static void packet_create_data_done(struct sk_buff *first, struct wireguard_peer bool is_keepalive, data_sent = false; timers_any_authenticated_packet_traversal(peer); + timers_any_authenticated_packet_sent(peer); skb_walk_null_queue_safe(first, skb, next) { is_keepalive = skb->len == message_data_len(0); if (likely(!socket_send_skb_to_peer(peer, skb, PACKET_CB(skb)->ds) && !is_keepalive)) |