Repository navigation
fix(pcapng)!: default the IDB snaplen to 0 and reject values the field cannot hold (#2278) - #2348
Merged
Merged
Conversation
Owner
Author
|
Review: NEEDS CHANGES at
|
…d cannot hold (#2278) _make_block_idb defaulted snaplen to 2**64 - 1, which the 32-bit SnapLen field truncates to 0xFFFFFFFF, so the made info disagreed with its octets; any explicit value outside 32 bits was truncated the same way. Default to 0 (no limit, per the PCAP-NG spec and the schema's own default) and raise ProtocolError for a snaplen outside 0..0xFFFFFFFF. Breaking: a make() without snaplen writes 0. Changelog entry added, CHANGELOG.md regenerated. Test: the default writes and reports 0, made info equals the parsed info for in-range values, and out-of-range values raise.
JarryShaw
force-pushed
the
fix/2278-pcapng-idb-snaplen-default
branch
from
October 27, 2026 02:11
b14b04e to
0a2bd83
Compare
Owner
Author
|
Amended Also filed, as separate pre-existing defects found in review (not caused by this PR): #2353 (a raw |
This was referenced Oct 28, 2026
JarryShaw
added a commit
that referenced
this pull request
Oct 28, 2026
Problem: of the 60 pull requests merged in the #2312-#2407 range, only #2334, #2336, #2337, #2340 and #2348 wrote a 1.5.0 changelog entry, and #2398 and #2403 only reworded lines that were already there. Every other user-visible change in the range -- wire-semantics fixes, maker guards, reassembly behaviour, public-API and error-message changes -- went unrecorded, so the entry no longer describes the release. Fix: one entry per user-visible pull request, in each module section's existing style and ordered by the issue it closes. Two pairs share a bullet, since each is the direct follow-up of the other: #2393 with #2401, and #2405 with #2407. The diff on the entry file is purely additive. Internal-only work is left out deliberately: dependency and action bumps (#2387 to #2391), test-only and docs-prose passes (#2333, #2376, #2379, #2380, #2402), the unreachable-branch removal (#2378), and the #: comment marker the HIP Group and Packet crawlers now write (#2381). That last one renders nothing either way: the marker lands inside the generated _missing_ body, conf.py's exclude-members drops _missing_ from autodoc, and a comment in a method body is not an attribute comment to begin with. #2392 and #2403 are recorded together, under Added rather than Fixed, for the declarations they introduce: __proto_key__ on the seven classes owning a __proto__ registry (#2392), __proto_dest__ on the four enum registries and Vendor.PROTO_DEST to generate it (#2403). Both PRs added the autodoc entries, so both are rendered public attributes. #2392's rejection-message change is deliberately not recorded as a fix: the bare "code must be ..." text it prefixed came from _check_code, which #2193 introduced and which is in no release tag -- absent at v1.5.0b14 -- so no released version ever emitted it. #2403 is no longer skipped as internal because it reworded an existing bullet to name __proto_dest__ while nothing credited the attribute's introduction. Four claims are corrected against the source rather than carried over: FTP_DATA shipped in pcapkit/protocols/application/ftp.py from 1.0.0, not 1.4.0 (class FTP_DATA(Raw) is there at v1.0.0); #2365's pre-fix fallback read cmmd.value, so a .value-carrying object was accepted unchecked rather than raising; #2399 left the dpkt adapter and the adapters' ModuleNotFound raises alone, so it claims no universal prefix; and #2397's old tail did name the version it got, so the entry quotes it and gains the :issue:`2302` it was missing. #2370's "a Section Header Block ... still fails" sentence is dropped: #2369 settles the byte order first, and an SHB built from raw octets with ctx=None now rebuilds byte-exact in both byte orders. CHANGELOG.md is regenerated with util/changelog_md.py. Test: tests/project/ in full, 0 failures, including test_changelog_md.py's in-step and supported-subset checks; util/changelog_md.py --check reports the two files in step; the entry parses under docutils with no structural warning.
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 testpasses, and a test case covers the change1.5.0.rst(breaking change)What is the purpose of your pull request?
fix — bug fixDescription
Closes #2278. Breaking: the default
snaplenchanges._make_block_idbdefaultedsnaplento0xFFFF_FFFF_FFFF_FFFF, which the 32-bit field silently truncated to0xFFFFFFFF. The default is now0, and a value outside0..0xFFFFFFFFraisesProtocolError.origin/main. Passing on the rebased head.