Skip to content

Commit

Permalink
fixup: reset pmtud_probe_pending_id when he_internal_pmtud_handle_pro…
Browse files Browse the repository at this point in the history
…be_timeout is called
  • Loading branch information
expressvpn-tom-l committed Oct 18, 2023
1 parent 247ec90 commit 600ab86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/he/pmtud.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions test/he/test_pmtud.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 600ab86

Please sign in to comment.