Repository navigation
fix(toolkit): drop a rejected trial's warnings in pypcapfile's header checks (#2526) - #2577
Merged
Merged
Conversation
…capfile (#2526) - `pypcapfile._default_extension_header` sets `_beholding` around its trial `_parse_next_layer` call, so a header that raises is dropped with its warnings, as `beholder` drops a replaced layer's (#2308). A HIP header cut to 8 octets no longer reports `packet length < 0` twice before answering None; a kept header still warns from the caller's line. - Pin the `_parse_next_layer` claim that a full-length layer outside `beholder` holds nothing: its warning comes before the layers it carries, which fails if the hold condition is replaced by `hold_warnings(True)`. - Name `beholder` in the Note's two sentences that called it "it". - Drop timed wording from the #2516 test docstrings. New tests fail without their fix; touched modules pass one at a time.
…r check (#2526) - `pypcapfile._default_accepts` holds the warnings of its trial IPv4 or TCP parse, and drops them when the parser raises (#2308). Setting `_beholding` would hold nothing there: the parser reads its own header, outside `_parse_next_layer`. A TCP header whose Timestamps option runs past its end no longer warns `packet length < 0` twice before answering False; an accepted header still warns from the caller's line, and under `error` a warning still answers False. - State `_beholding`'s meaning to cover `_default_extension_header`, which sets it too. - Name `beholder` in the `_parse_next_layer` Note sentence that called it "it". New tests fail without their fix; touched modules pass one at a time.
Owner
Author
|
Cross-review (Sonnet) of both commits: GOOD TO GO. The rebase onto main after #2519 leaves the patch-id unchanged (
|
JarryShaw
added a commit
that referenced
this pull request
Nov 1, 2026
- Added: one's-complement checksum verification and computation (#2543), and the IPX and SCTP registration wrappers (#2521). - Folded into unreleased entries: LinuxSLL/FRAD/Netlink registries (#2527), the IGMP class names (#2542), TLS record chaining and the SSLv2 trial's warnings (#2537), DTLS reassembly via Extractor and toolkit (#2528), and IP_Pseudo's walk at any depth (#2543). ICMP drops its stale checksum line. - Breaking: make() checksums, DRARP's module (#2540), IPv6 overlapping fragments (#2569), TCP_GAP_LIMIT replacing TCP.__window__ (#2579), and Extractor/extract's positional dtls (#2528). - Changed: member order (#2490), conventions (#2542, #2521, #2570), CI -n logical (#2572). Fixed: AppType.get (#2568), trial warnings (#2519, #2577). - 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 defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseconst— regenerates constant or registry tables, members keeping their numeric valuesDescription of your pull request and other information
Closes #2526. Applies #2308's rule to pypcapfile's trial parses: a trial that is rejected reports nothing through warnings.
_default_extension_headersets_beholdingaround its extension-header trial, so a raising trial's warnings are dropped as underbeholder._default_accepts(the header check) also leaked: the constructor reads its header outside_parse_next_layer, so_beholdingdoes not reach it. It now holds the trial's warnings withhold_warningsand discards them when the trial raises. Under anerrorfilter, a header that warns answers False and nothing escapes.ProtocolErrorat CRITICAL. That isBaseError's loudness, which fix(protocols): a trial parse that raises and is kept as Raw still emits SchemaWarnings #2308 does not cover.