From 5eee1f39032c894e6cb30060fa8bfb7859eff729 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 19 Oct 2016 17:20:25 +0900 Subject: receive: always send confirmation, even if queue is empty Signed-off-by: Jason A. Donenfeld --- src/receive.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/receive.c b/src/receive.c index 6dda410..307baff 100644 --- a/src/receive.c +++ b/src/receive.c @@ -142,7 +142,11 @@ static void receive_handshake_packet(struct wireguard_device *wg, void *data, si timers_ephemeral_key_created(peer); timers_handshake_complete(peer); peer->sent_lastminute_handshake = false; - packet_send_queue(peer); + /* Calling this function will either send any existing packets in the queue + * and not send a keepalive, which is the best case, Or, if there's nothing + * in the queue, it will send a keepalive, in order to give immediate + * confirmation of the session. */ + packet_send_keepalive(peer); } break; default: -- cgit v1.2.3