summaryrefslogtreecommitdiffhomepage
path: root/src/timers.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/timers.c
parent4a5231e2ba26f8567faffe2fac83fe8cabf52160 (diff)
persistent keepalive: use authenticated keepalives
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.c')
-rw-r--r--src/timers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/timers.c b/src/timers.c
index edc6da3..8ef1469 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -82,7 +82,8 @@ static void expired_send_persistent_keepalive(unsigned long ptr)
if (unlikely(!peer->persistent_keepalive_interval))
return;
- socket_send_buffer_to_peer(peer, NULL, 0, 0);
+ pr_debug("Sending keep alive packet to peer %Lu (%pISpfsc), since we haven't sent or received authenticated data for %u seconds\n", peer->internal_id, &peer->endpoint_addr, peer->persistent_keepalive_interval);
+ packet_send_keepalive(peer);
}
void timers_data_sent(struct wireguard_peer *peer)
@@ -130,7 +131,7 @@ void timers_ephemeral_key_created(struct wireguard_peer *peer)
do_gettimeofday(&peer->walltime_last_handshake);
}
-void timers_any_packet_sent(struct wireguard_peer *peer)
+void timers_any_authenticated_packet_traversal(struct wireguard_peer *peer)
{
if (peer->persistent_keepalive_interval && likely(peer->timer_persistent_keepalive.data))
mod_timer(&peer->timer_persistent_keepalive, jiffies + HZ * peer->persistent_keepalive_interval);