Repository navigation
tcpip: verify UDP checksums within the declared datagram length - #2
Merged
ScottMoore0 merged 1 commit intoNov 3, 2026
Merged
Conversation
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.
Valid checksummed UDP datagrams with trailing bytes in the IPv4 payload were dropped because receive verification included the surplus area in both the checksum and pseudo-header length. For example, a length-11 datagram carrying
hi!stops verifying when one surplus byte is appended.Validate the UDP length (at least eight bytes and no longer than the received buffer), then trim to that length before checksum verification. Continue to accept absent IPv4 checksums and discard truncated or corrupt datagrams. This follows RFC 768 and RFC 9868 sections 7–9; surplus bytes are ignored without implementing UDP options.
Preserve the existing universal packet-receive law and update its proof and generator. Add 86 independently constructed Python wire/checksum cases to the reference runner; 18 fail before the fix and all pass afterward.
Validation with Bend 2.0.39 and Lean 4.34.0:
scripts/check.sh tcpipandVERDICT=1 scripts/check.sh tcpipscripts/deps.sh tcpipandpython3 scripts/internals.py tcpippython3 ref/gen_packet.py --checkfromtcpip/Independent GPT-6.1-Terra medium review using review-agent returned no findings.