aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/timers.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-12-09 18:18:55 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-12-09 21:31:12 +0100
commit23a7fa09ddd6123dc8e89539d48bb3dffc28fb23 (patch)
tree4966d428a2d847d9fd35a4fe639608e2baba9b2a /src/timers.c
parentcontrib: add wg-config (diff)
downloadwireguard-monolithic-historical-23a7fa09ddd6123dc8e89539d48bb3dffc28fb23.tar.xz
wireguard-monolithic-historical-23a7fa09ddd6123dc8e89539d48bb3dffc28fb23.zip
socket: clear src address when retrying handshake
Diffstat (limited to 'src/timers.c')
-rw-r--r--src/timers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timers.c b/src/timers.c
index 0b536d3..a11eb90 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -39,6 +39,10 @@ static void expired_retransmit_handshake(unsigned long ptr)
mod_timer(&peer->timer_kill_ephemerals, jiffies + (REJECT_AFTER_TIME * 3));
goto out;
}
+
+ /* We clear the endpoint address src address, in case this is the cause of trouble. */
+ socket_clear_peer_endpoint_src(peer);
+
packet_queue_handshake_initiation(peer);
++peer->timer_handshake_attempts;
out:
@@ -60,6 +64,8 @@ static void expired_new_handshake(unsigned long ptr)
{
peer_get_from_ptr(ptr);
pr_debug("Retrying handshake with peer %Lu (%pISpfsc) because we stopped hearing back after %d seconds\n", peer->internal_id, &peer->endpoint.addr_storage, (KEEPALIVE_TIMEOUT + REKEY_TIMEOUT) / HZ);
+ /* We clear the endpoint address src address, in case this is the cause of trouble. */
+ socket_clear_peer_endpoint_src(peer);
packet_queue_handshake_initiation(peer);
peer_put(peer);
}