Skip to content

fix(protocols): PCAPNG.register restores the shipped descriptor; a zero snaplen drops SPB padding (#1504, #1558) - #1573

Merged
JarryShaw merged 1 commit into
mainfrom
fix/1502-1504-1558-pcapng
Oct 10, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/1502-1504-1558-pcapng

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly

  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])

  • Use Preview tab to see how your pull request will actually look like

  • Searched for similar pull requests

  • Followed the coding style (make pylint, make mypy, make isort) — Makefile flags on the changed modules, no new findings

  • make test passes, and a test case covers the change — narrow selections only, not the full suite

  • Added a changelog entry under docs/source/changelog/ and regenerated CHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Description of your pull request and other information

Closes #1504
Closes #1558

…ro snaplen drops SPB padding (#1504, #1558)

- PCAPNG.register shares ProtocolBase._next_layer_entry, as the other six
  registrars do since #1533, so handing back the shipped ModuleDescriptor
  stores that object, unresolved. Delete the Gap(1504) row and add PCAPNG to
  the #1504 per-site tests.
- PCAPNG engine: _get_snaplen hands over no limit when interface 0's snaplen
  is 0, instead of passing the 0 through as a limit of no octets.
- PCAPNG.unpack reads a zero __packet__ snaplen as no limit too, so a Simple
  Packet Block's padding is no longer read as packet data.
- New tests for the extracted and parsed SPB, both rebuilding byte-exactly.

Closes #1504
Closes #1558
@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 10, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 0f4652b1f. Cross-reviewed on Sonnet; the author ran Opus. It merges cleanly into current main (cc084357f).

Not this PR's: a truncated SPB (snaplen 10, original length 57) emits SchemaWarning: packet length < 0: -2 and -4 while parsing. I measured it identically on main, and I'm filing it separately.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 89.64% (unit tier, Python 3.14, 0f4652b1f, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 4 93.55%
pcapkit/const 18858 957 2366 871 91.03%
pcapkit/corekit 2240 67 722 34 96.32%
pcapkit/dumpkit 258 2 90 2 98.85%
pcapkit/foundation 2766 129 980 47 94.23%
pcapkit/interface 108 7 36 5 91.67%
pcapkit/protocols 16990 230 4542 191 98.02%
pcapkit/toolkit 697 100 232 7 84.61%
pcapkit/utilities 431 4 124 4 98.56%
pcapkit/vendor 4409 2342 1006 157 43.25%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit e9f3340 into main Oct 10, 2026
40 checks passed
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

1 participant