Repository navigation
fix(protocols): rebuild a cut header with the next layer it parsed with (#2717) - #2759
Merged
Merged
Conversation
Owner
Author
|
NEEDS CHANGES at
|
…th (#2717) - A header the capture cut short, read at the octets captured, leaves its next layer a negative length, which kept it Raw. from_data reads the rebuild at the width the header declares (#2703), which leaves none, so the rebuild was NoPayload: the same octets, another layer chain. - from_data tells the rebuild of a cut header whether its data model kept a Raw next layer, which only a parse short of the header's width does, as _short_of_header. ProtocolBase._empty_next_layer keeps that next layer Raw for the rebuild, and for a parse leaving a negative length with no octets past the header, now without dispatching on a code the cut may have read as zeros. ProtocolBase, Internet, LinuxSLL and FRAD's SNAP path use it in place of their own length checks. - The Protocol page documents _empty_next_layer and the rebuild attributes its docstrings link: __reconstructing__, __short_read__, _uncaptured and _short_of_header. test_cut_header_next_layer_2717_unit fails without the fix. The plain unittest legs, both schema round trips, the short-read suites and the project guards pass; the shipped captures parse the same chains.
JarryShaw
force-pushed
the
fix/2717-cut-header-rebuild-next-layer
branch
from
November 4, 2026 06:13
96385b8 to
eb8443f
Compare
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 94.45% (unit tier, Python 3.15,
Per-file detail: the |
This was referenced Nov 4, 2026
JarryShaw
added a commit
that referenced
this pull request
Nov 4, 2026
- Fixed: a cut header's rebuild keeps the next layer its parse had, where 1.5.x rebuilt a cut Ethernet header's Raw as NoPayload, and that Raw carries no error (#2759), a new entry; old values measured against v1.5.1. - Amended unreleased entries (#2758): a cut list of schema items ends with the data, the item the cut lands inside zero-filled and none past it, in the ListField, IGMP and HTTP/2 SETTINGS entries, the last also rebuilding at its declared Length or a recomputed one once edited. - Folded (#2755): a counted item the data ends inside reads as a quiet short read, into the ListField and IGMP entries. - 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
A header the capture cut short is parsed at the octets captured, which hands its next layer a negative length, so the parse keeps
Raw.from_datarebuilds it at its declared width (#2703), so the next layer's length is 0 and the rebuild gotNoPayload. Same octets, but a different layer chain.from_datanow records (_short_of_header) when a cut header's data model keptRaw, and the newProtocolBase._empty_next_layerkeepsRawfor that rebuild.Raw, without dispatching on a zero-filled code. Such aRawno longer carries the failed dispatch'serror.ProtocolBase,Internet,LinuxSLLand FRAD's SNAP path use the helper instead of their own checks.__proto__, cut at every octet. Besides the issue's cases, 22 more classes rebuilt a different chain on main (ARP family, AH, HIP, IPv6 extension headers, MH, VLAN, L2TPv2, LinuxSLL1/2, Loopback). It fails on main with 550 failures and passes here.options,reserved,length) parse differently from their rebuild, though the chains match.Closes #2717