Repository navigation
fix(tcp): rebuild a TCP header with the End of Option List padding its parse read (#2769) - #2775
Merged
Merged
Conversation
…s parse read (#2769) TCP.make writes the octets after an End of Option List inside the options it builds, through _make_tcp_options, and sets no padding on the schema, so TCP.read, which took padding from that schema, read a made or rebuilt header's padding as empty while its octets were exact. TCP.read now slices the padding from the octets past the options it read, as IPv4.read does, so from_data over info or to_dict() reads what the parse read. Adds test_tcp_eool_padding_2769_unit (ALL tier): zero to three octets after EOOL, zero and non-zero, standalone and inside IPv4, from info and to_dict(), and a made header against the parse of its own octets.
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 94.45% (unit tier, Python 3.15,
Per-file detail: the |
JarryShaw
added a commit
that referenced
this pull request
Nov 4, 2026
- Fixed, a new entry beside the cut-header one: a whole header rebuilt through from_data reads back what its parse read. An extension header parsed with extension=True rebuilds in that mode, where 1.5.x's rebuild gained next-layer keys, and a rebuilt Shim6 header keeps its protocol, where 1.5.x's was None (#2774); a rebuilt or made TCP header reads its padding past the End of Option List, where 1.5.x read it as empty (#2775). Both measured on a v1.5.1 export. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
1 of 5 tasks
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.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
TCP.makewrites End of Option List padding intooptionsand never sets the schema'spaddingfield. A rebuilt or made TCP header then readpaddingasb'', where its parse readb'\x00\x00\x00'.TCP.readnow slices the padding from the octets after the options, asIPv4.readalready does. Only the method body changes, and TCP's 1.6.0versionchangedblock gains one bullet. A header built withmake()now reports its alignment zeros aspadding, as parsing its own octets does.opt_endofopton rebuild through its own code. That is filed separately.infoand fromto_dict(). It fails on main with 16 failures and passes here.Closes #2769