From 09847c27d4b9af8ce296215ed270ebfb4d08b23c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 19 Oct 2016 15:46:28 +0900 Subject: timers: only have initiator rekey If it's time to rekey, and the responder sends a message, the initator will begin the rekeying when sending his response message. In the worst case, this response message will actually just be the keepalive. This generally works well, with the one edge case of the message arriving less than 10 seconds before key expiration, in which the keepalive is not sufficient. In this case, we simply rehandshake immediately. --- src/packets.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/packets.h') diff --git a/src/packets.h b/src/packets.h index f2ce2b7..035c548 100644 --- a/src/packets.h +++ b/src/packets.h @@ -31,6 +31,7 @@ void packet_send_keepalive(struct wireguard_peer *peer); void packet_send_handshake_initiation(struct wireguard_peer *peer); void packet_send_handshake_response(struct wireguard_peer *peer); void packet_send_handshake_cookie(struct wireguard_device *wg, struct sk_buff *initiating_skb, void *data, size_t data_len, __le32 sender_index); +void packet_send_handshake_initiation_ratelimited(struct wireguard_peer *peer); void packet_queue_send_handshake_initiation(struct wireguard_peer *peer); void packet_process_queued_handshake_packets(struct work_struct *work); -- cgit v1.2.3-59-g8ed1b