Skip to content

Commit

Permalink
Remove pmtud struct access from outside pmtud module
Browse files Browse the repository at this point in the history
Since `he_internal_pmtud_handle_probe_ack` handles (id != conn->pmtud.probe_pending_id)
we do not need to check before calling the probe pending id
  • Loading branch information
kp-mariappan-ramasamy committed Jan 3, 2025
1 parent 4f1f9d3 commit df92ff0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/he/msg_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,9 @@ he_return_code_t he_handle_msg_pong(he_conn_t *conn, uint8_t *packet, int length
if(id == conn->ping_pending_id) {
// Tell the host application that we received a PONG
he_internal_generate_event(conn, HE_EVENT_PONG);
return HE_SUCCESS;
}
if(id == conn->pmtud.probe_pending_id) {
} else {
// Received ack of a pmtud probe
he_internal_pmtud_handle_probe_ack(conn, id);
return HE_SUCCESS;
}

// Ignore the pong message
Expand Down
2 changes: 2 additions & 0 deletions test/he/test_msg_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ void test_msg_handler_pong_pmtud_ack(void) {
void test_msg_handler_pong_mismatch_id(void) {
conn->ping_pending_id = 42;

he_internal_pmtud_handle_probe_ack_ExpectAndReturn(conn, 999, HE_SUCCESS);

he_msg_pong_t *pong = (he_msg_pong_t *)empty_data;
pong->id = htons(999);
ret = he_handle_msg_pong(conn, (uint8_t *)pong, sizeof(he_msg_pong_t));
Expand Down

0 comments on commit df92ff0

Please sign in to comment.