Repository navigation
Conversation
ulTCPWindowTxSack() passed every received SACK block to prvTCPWindowTxCheckAck() unchecked, so a block starting at SND.UNA freed the covered segments and advanced SND.UNA. RFC 2018 section 8 leaves releasing data to the cumulative ACK. Use a block only when SND.UNA < left edge < right edge <= SND.NXT, with the same SND.NXT and FIN handling as ulTCPWindowTxAck(). A SACK can now only mark segments as acknowledged, and ignored blocks no longer count towards fast retransmit. Add a unit test for each rejected case, plus FIN and sequence-wrap cases, and set SND.NXT in the existing SACK tests. We thank Systina12 (https://github.com/Systina12) for their help identifying this issue.
Contributor
Contributor
|
Good news @yitingb, we tested it and the change looks good! Here is a copy of the testing script: Validate_SACK_block_ranges.zip I tested before and after applying the patch. This is after: |
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.
Description
This change adds SACK block validation to
ulTCPWindowTxSack(), to match the ACK range check added in #1367.A SACK block starting at SND.UNA made
prvTCPWindowTxCheckAck()free the segments it covered and advance SND.UNA. RFC 2018 section 8 says "the sender MUST NOT discard data before it is acknowledged by the Acknowledgment Number field in the TCP header". A block is now used only when SND.UNA < left edge < right edge <= SND.NXT, with the same SND.NXT and FIN handling asulTCPWindowTxAck(). A SACK can still mark segments as acknowledged, but only the cumulative ACK frees them. Ignored blocks no longer count towards fast retransmit either.Two notes for review:
ulFirst < SND.NXTcomparison is needed because sequence numbers wrap. Without it, a block that starts after SND.NXT can pass the other three comparisons.ulTCPWindowTxSack()now returns 0 for every block. Its caller,prvReadSackOption(), is left unchanged to keep the diff small.We thank Systina12 (https://github.com/Systina12) for their help identifying this issue.
Test Steps
ulTCPWindowTxSack(): one for each comparison, plus a block covering a sent FIN, a window that wraps past 2^32, and the state after a FIN is sent. 6 of them fail without the source change.tx.ulHighestSequenceNumber, because the new check reads it. Their expected results are unchanged.FreeRTOS_TCP_WIN.ckeeps 100% line and branch coverage. Formatting and spell check pass.Checklist:
Related Issue
None.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.