Repository navigation
fix(protocols): rebuild a cut header at the width its parse read it (#2761) - #2777
Merged
Merged
Conversation
…2761) A cut header's rebuild was read at the width make() packs, so an IPv6_Ext cut at one octet, whose length is the width its parse was given, rebuilt with a length of two. - Data: a __short_width__ key, carried by to_dict() and left out of repr and the dumps, records the length the parse read a cut header at. - keep_short_read records it beside __short_read__, from the length each layer base passes on; Protocol.from_data reads the rebuild at it. - It replaces Protocol._uncaptured and _short_of_header: read at its parse's width, the rebuild leaves its next layer the length its parse did. - The #2767 sweep drops its known gap; the IGMPv3 direct-vs-IPv4 tests set the width aside, each read at its own; utilities-or-corekit.rst records the ruling. The new tests fail without the fix; every sample capture rebuilds unchanged.
Owner
Author
|
GOOD TO GO at
|
1 of 5 tasks
JarryShaw
added a commit
that referenced
this pull request
Nov 4, 2026
- #2777: the cut-header sentence reads the length back too, the rebuild read at the width its parse was given (__short_width__); the ruling into the conventions entry. - #2778: a PCAP-NG block with octets after opt_endofopt rebuilds an info holding its options and padding_opts, where 1.5.1 rebuilt none, into the whole-header rebuild entry; 1.5.0's frozen entry is left as written. - #2779: SCTP's reorder, the source-ordered member lists and the sorted Option.register clash warning ('opt', 'if', 'epb', ... in 1.5.1), into the member-order entry; the layer-grouped registry and the warning name restore ('put back silently' in 1.5.1), into the #2770 entry; the page wording into the conventions entry. - #2781: import_lock serialising first resolutions, into the lazy-import entry; the removed registry lock never shipped and stays unnamed. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
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
This closes the last #2761 gap, following option (a) as ruled on the issue. A cut
IPv6_Extparsed at 1 octet rebuilt at the 2 octetsmake()packs, because the data model never recorded the width the parse was given.keep_short_readnow records a new__short_width__key next to__short_read__, andProtocol.from_datarebuilds at that width. The key behaves like__short_read__:to_dict()carries it, andreprand the dumps leave it out._uncaptured(fix(protocols): a layer rebuilt by from_data from a cut capture verifies before its short read is replayed #2703) and_short_of_header(fix(protocols): a cut header parses with a Raw next layer but rebuilds with NoPayload #2717), and both are deleted. All 69 related modules (fix(protocols): a layer rebuilt by from_data from a cut capture verifies before its short read is replayed #2703, fix(protocols): a cut header parses with a Raw next layer but rebuilds with NoPayload #2717/fix(protocols): rebuild a cut header with the next layer it parsed with (#2717) #2759, fix(protocols): a cut standalone IPv6 extension header rebuilds with values its parse did not read #2761/fix(protocols): rebuild a cut standalone header with the values its parse read (#2761) #2767, fix(corekit): a capture cut inside an option area is refused, and loudly, instead of a short read #2694/fix(internet): a cut leaving only the type octet of a CALIPSO, SMF_DPD or MPL option logs a FieldValueError #2727, fix(protocols): rebuild noise and cut-recording gaps found reviewing #2703 #2711, short-read) pass before and after.KNOWNgap table in fix(protocols): rebuild a cut standalone header with the values its parse read (#2761) #2767's sweep is removed. Two fix(protocols): rebuild noise and cut-recording gaps found reviewing #2703 #2711 tests compared a bare parse with the same cut inside IPv4; they now pin the width each one records.infoare identical to main (with the width set aside), and the width appears only on short-read layers.Closes #2761