aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-07-08 20:34:32 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-07-10 03:46:56 +0200
commit2e1bceea1388e2bd57b4ef17fb21190a8755d71e (patch)
tree4ed954d5f2877adbe474e82c7564e6b612f86796 /src/send.c
parentkeepalives: only queue keepalive when queue is empty (diff)
downloadwireguard-linux-compat-2e1bceea1388e2bd57b4ef17fb21190a8755d71e.tar.xz
wireguard-linux-compat-2e1bceea1388e2bd57b4ef17fb21190a8755d71e.zip
persistent keepalive: use authenticated keepalives
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/send.c b/src/send.c
index e1d8010..6992fd4 100644
--- a/src/send.c
+++ b/src/send.c
@@ -23,6 +23,7 @@ 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);
socket_send_buffer_to_peer(peer, &packet, sizeof(struct message_handshake_initiation), HANDSHAKE_DSCP);
timers_handshake_initiated(peer);
}
@@ -39,6 +40,7 @@ void packet_send_handshake_response(struct wireguard_peer *peer)
cookie_add_mac_to_packet(&packet, sizeof(packet), peer);
if (noise_handshake_begin_session(&peer->handshake, &peer->keypairs, false)) {
timers_ephemeral_key_created(peer);
+ timers_any_authenticated_packet_traversal(peer);
socket_send_buffer_to_peer(peer, &packet, sizeof(struct message_handshake_response), HANDSHAKE_DSCP);
}
}
@@ -136,6 +138,7 @@ static inline void send_off_bundle(struct packet_bundle *bundle, struct wireguar
* consumes the packet before the top of the loop comes again. */
next = skb->next;
is_keepalive = skb->len == message_data_len(0);
+ timers_any_authenticated_packet_traversal(peer);
if (likely(!socket_send_skb_to_peer(peer, skb, 0 /* TODO: Should we copy the DSCP value from the enclosed packet? */) && !is_keepalive))
timers_data_sent(peer);
}