From 600ab8686632103b740b0fb7fddf234795bbc435 Mon Sep 17 00:00:00 2001 From: Tom L <98499638+expressvpn-tom-l@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:11:29 +0800 Subject: [PATCH] fixup: reset pmtud_probe_pending_id when he_internal_pmtud_handle_probe_timeout is called --- src/he/pmtud.c | 1 + test/he/test_pmtud.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/he/pmtud.c b/src/he/pmtud.c index ac056406..17a6f2ac 100644 --- a/src/he/pmtud.c +++ b/src/he/pmtud.c @@ -134,6 +134,7 @@ he_return_code_t he_internal_pmtud_handle_probe_timeout(he_conn_t *conn) { } // Reset probe count + conn->pmtud_probe_pending_id = 0; conn->pmtud_probe_count = 0; // PROBE_COUNT reaches MAX_PROBES, decide what to do based on state diff --git a/test/he/test_pmtud.c b/test/he/test_pmtud.c index 53cfe277..fabdf1b9 100644 --- a/test/he/test_pmtud.c +++ b/test/he/test_pmtud.c @@ -238,8 +238,9 @@ void test_he_internal_pmtud_handle_probe_timeout_confirm_base_failed(void) { // The new state should be Error TEST_ASSERT_EQUAL(HE_PMTUD_STATE_ERROR, conn.pmtud_state); - // The probe count should be reset to 0 + // The probe count and pending id should be reset to 0 TEST_ASSERT_EQUAL(0, conn.pmtud_probe_count); + TEST_ASSERT_EQUAL(0, conn.pmtud_probe_pending_id); } void test_he_internal_pmtud_handle_probe_timeout_search_completed(void) { @@ -258,8 +259,9 @@ void test_he_internal_pmtud_handle_probe_timeout_search_completed(void) { // The effective mtu should be set TEST_ASSERT_EQUAL(1212 - PMTUD_PROBE_SMALL_STEP, conn.effective_pmtu); - // The probe count should be reset to 0 + // The probe count and pending id should be reset to 0 TEST_ASSERT_EQUAL(0, conn.pmtud_probe_count); + TEST_ASSERT_EQUAL(0, conn.pmtud_probe_pending_id); } void test_he_internal_pmtud_handle_probe_timeout_blackhole_detected(void) {