Conversation
Stop reassembly before the tail that will be dropped and avoid subtracting an RX sequence advance after the drop path sets the window absolutely. Constrain advertised windows in all three TCP header builders so an invalid internal window cannot overwrite the data offset or flags. Add an in-tree regression using real sockets, packet pools and TCP code. Cover queue-limit hole fills, short queues under pool pressure, superset retransmissions, delivered bytes and all three header construction paths. Enable low-watermark tests in v4_build and v4_full_build to exercise both window-scaling configurations. Fixes eclipse-threadx#433 Assisted-by: OpenAI Codex
Sawii00
marked this pull request as ready for review
September 15, 2026 07:47
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #433.
When a segment fills a receive-queue hole under low-watermark pressure, the drop path can set the receive window using the advanced receive sequence and then subtract that advance again. The resulting wrap can corrupt the TCP flags, including setting RST. Reassembly can also acknowledge the tail before dropping it when pool pressure or a superset retransmission leaves a shorter queue.
This PR applies the four-file patch from the issue to
dev:Regression coverage
Add
netx_tcp_low_watermark_rx_window_testto the existing CMake regression suite. It uses real NetX sockets, packet allocation/release, TCP reassembly, send, and retransmission code. A sink IP driver inspects outgoing TCP headers; received segments are injected at the reassembly boundary to make the sequences deterministic.Coverage includes:
Enable
NX_ENABLE_LOW_WATERMARKin the existingv4_buildandv4_full_buildprofiles. This runs the regression, along with existing low-watermark tests, without and withNX_ENABLE_TCP_WINDOW_SCALINGrespectively.Validation
Locally tested in Ubuntu 24.04, Linux x86 32-bit, GCC 14, with the repository-pinned ThreadX and FileX submodules:
-Werror -Wall -Wextra -pedantic -Wconversion -Wmissing-declarations.git diff --checkpass.The selected CTests were run with:
The full repository test matrix has not been run locally.
AI disclosure
The fix and regression coverage were developed with OpenAI Codex assistance. Edited files include AI disclosures, and the commit includes an
Assisted-by: OpenAI Codextrailer. The Eclipse Contributor Agreement has been signed.