Repository navigation
fix(protocols): report a rebuilt frame's messages once and record cuts on the layer (#2711) - #2738
Merged
Merged
Conversation
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 94.44% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
NEEDS CHANGES, following the ruling on #2711 (option 2). An overstated count in a standalone header-only IGMPv3 Report must read deterministically. Records past those present are never zero-filled, and the cut is recorded through a new list-field mechanism, not the zero-fill budget. Round 5 is in progress; the rest of the PR stands. |
Owner
Author
|
resolve conflicts |
Owner
Author
…s on the layer (#2711) - Rebuilding an outer layer rebuilt its payload by from_data, whose own parse reported what the octets carry, and then parsed them again itself, so Ethernet over a cut IGMPv3 reported its messages twice. Under rebuilding, ProtocolBase.__post_init__ drops the payload's parse warnings with hold_warnings, and beholder builds the errors it absorbs quiet through CaughtByCaller and logs none; the enclosing layer's parse reports them once. The owner ruled on #2711 that this carve-out from the handled-refusals rule stands, as protocol-family-grouping.rst now records. - An IGMPv3 Report parsed on its own and cut on a field boundary before its counted records read INVALID. ListField now takes a count: a list whose octets hold fewer items than it counts reports the shortfall, and Schema.unpack records it as a short read, the items absent never made up; the fields after it find the record in packet, as #2727 gives them. Report.records counts num_group_records for a message parsed on its own, so such a cut reads TRUNCATED whatever the context parsed before; inside a frame the count sizes nothing. A count no IP payload could carry raises ProtocolError. - A message cut inside the length its context gives it read TRUNCATED in its frame but INVALID rebuilt on its own. Schema.unpack records a cut in a payload of a declared length; keep_short_read records a frame cut on a layer only where Schema._frame_end_field finds its last field sized by what is left of the length it was given, so a layer whose header declares its end (IPv4, IPv6 and its extension headers, UDP, an HTTP/2 frame) records none at or past it, nor one ending in a list, as SCTP's chunks, whose buffer holds only what its items took. The TSO IPv4 payload is sized that way, and ICMPv4 reads a recorded cut as TRUNCATED, as GRE and IGMP do. - Tests that pinned no record for those cuts now pin the record. The new modules fail without the fix; the protocols, corekit, foundation, utilities and project modules pass. Sample captures give the same octets and messages; cut frames gain __short_read__ on Ethernet, IPv4 and UDP. Closes #2711
JarryShaw
force-pushed
the
fix/2711-rebuild-noise-cut-record
branch
from
November 3, 2026 18:01
c9e0c96 to
2ade9f4
Compare
Owner
Author
|
Round 5 (option 2) is pushed, rebased onto main
|
Owner
Author
|
GOOD TO GO at
|
JarryShaw
added a commit
that referenced
this pull request
Nov 3, 2026
- Fixed: a layer rebuilt by from_data reports its payload's messages once, where 1.5.x logged them twice, and IPv4 and the frame-end layers record a cut as their own short read (#2738), a new entry; old values measured against v1.5.1. - Folded into unreleased entries (#2738): a standalone IGMPv3 Report sized by its record count, into the IGMP entry; the recorded cuts' TRUNCATED status, TSO IPv4 and ICMPv4 included, into the checksum entry; ListField's count, into its zero-fill entry; the quiet rebuilt payload, into the conventions entry. - #2748: pcapkit.utilities.lazy becomes pcapkit.utilities.importlib in the lazy-import and conventions entries; the old name appears nowhere. - No entry for the direct-pushed 21ec0a6, which has no pull request or issue to cite. - 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 defectThree rebuild and cut-recording gaps found while reviewing #2703.
_make_payload, its warnings are held, andbeholderabsorbs errors quietly. The outer layer's own parse still reports each message once. The owner ruled for this on fix(protocols): rebuild noise and cut-recording gaps found reviewing #2703 #2711, and the "Handled Refusals" page records the exception.IP_MAX_LENGTHraisesProtocolError. Where the zero-fill budget would be exceeded, the parse reads as onmain, so it never newly raises.Schema.unpacknotes a cut in a declared payload. A frame cut is recorded on a layer only throughSchema._frame_end_field, whose last field is sized by the length the layer was given. That covers GRE, ICMP, IGMP, Ethernet and TSO IPv4. A layer that declares its own extent records nothing past it, and neither does one that ends in a list. Those are IPv4, IPv6, UDP, HTTP/2, SCTP and the option-area headers.ICMPv4.readreads a recorded cut as TRUNCATED.The shipped captures keep their octets and messages, and every per-layer rebuild is exact; only genuinely cut layers gain
__short_read__. The new tests fail onmain. A trial merge with #2737 passes both sides' tests.Closes #2711