feat: add rfc-compliant syn with payload handling #79
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.
Overview
This MR introduces SYN_WITH_PAYLOAD_ENABLED configuration option to handle the edge case where a SYN packet contains payload data, ensuring RFC compliance and robustness testing tools passes .
Current Behavior:
lwIP ignores payload in SYN packets and responds with ACK = seqno + 1
Only accounts for the SYN flag, not any accompanying data
Even if is very rarely this behavior is not strictly RFC-compliant ,and can be speculate by security scanners.
RFC Requirement:
According to TCP RFC specifications, the ACK number should reflect the sequence number incremented by:
New behavior:
lwIP SYN packets responds with correct ACK = seqno + the size of any received payload
Benefits:
Explicitly allowed by the TCP specification
Checked by robustness testing tools to validate TCP stack correctness
Used by security scanners to test RFC compliance
Interoperability: Works correctly with all TCP implementations