diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-09 18:18:55 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-09 21:31:12 +0100 |
commit | eb2513fdaa0f9b589e5b525cdf973b4751d91fe6 (patch) | |
tree | 00c76af7453dac7a9a40c57859f1dd8631d7771f /src/timers.c | |
parent | device: traditional if is cleaner than switch for this small (diff) | |
download | wireguard-linux-compat-eb2513fdaa0f9b589e5b525cdf973b4751d91fe6.tar.xz wireguard-linux-compat-eb2513fdaa0f9b589e5b525cdf973b4751d91fe6.zip |
socket: clear src address when retrying handshake
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.c')
-rw-r--r-- | src/timers.c | 6 |
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); } |