From 331dc8e5edfe77e0c0bfacf98cebad137aab9a3e Mon Sep 17 00:00:00 2001 From: Tom L <98499638+expressvpn-tom-l@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:26:02 +0800 Subject: [PATCH] fixup: always stop current pmtud timer when ack received --- src/he/pmtud.c | 5 +++++ test/support/test_defs.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/he/pmtud.c b/src/he/pmtud.c index 1ef516f2..3669c2ce 100644 --- a/src/he/pmtud.c +++ b/src/he/pmtud.c @@ -82,6 +82,11 @@ he_return_code_t he_internal_pmtud_handle_probe_ack(he_conn_t *conn, uint16_t pr return HE_SUCCESS; } + // Stop the timer + if(conn->pmtud_time_cb) { + conn->pmtud_time_cb(conn, 0, conn->data); + } + // Reset the pending probe id conn->pmtud_probe_pending_id = 0; diff --git a/test/support/test_defs.h b/test/support/test_defs.h index 92cc9b4b..b6de5810 100644 --- a/test/support/test_defs.h +++ b/test/support/test_defs.h @@ -87,7 +87,9 @@ he_return_code_t pop_network_config_cb(he_conn_t *conn, he_network_config_ipv4_t } he_return_code_t pmtud_time_cb(he_conn_t *conn, int timeout, void *context) { - call_counter++; + if(timeout > 0) { + call_counter++; + } return HE_SUCCESS; }