Skip to content

fix(protocols): set NoPayload on terminal extension-header layers - #2488

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2487-extension-header-membership
Oct 31, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2487-extension-header-membership

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Closes #2487

  • Searched for similar pull requests
  • Followed the coding style (make pylint, make mypy, make isort)
  • make test passes, and a test case covers the change
  • Added a changelog entry under docs/source/changelog/ and regenerated CHANGELOG.md, if the change is user-visible — N/A

What is the purpose of your pull request?

  • fix — corrects a defect

Description of your pull request and other information

  • HOPOPT, IPv6_Opts, IPv6_Route, IPv6_Frag, HIP, MH and the generic fallback (Shim6) return early in extension mode, before _decode_next_layer sets _next, so 'x' in layer raised AttributeError.

  • These layers now hold NoPayload on that path. The upper layer belongs to the enclosing IPv6 header.

  • Regression tests build frames in memory, including Shim6 in test_ipv6_ext_unit.py. The Shim6 test fails on origin/main with AttributeError.

  • test_ipv6_ext_unit.py and test_ah_unit.py: 45 passed

  • examples/generators/make_samples.py runs

  • isort --check -l100 -p pcapkit clean on changed files

@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 31, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

NEEDS CHANGES (Sonnet, 7ceb5d5e9). Six read() methods, six new tests and the ESP/TCP probes hold on main.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 31, 2026
- HOPOPT, IPv6_Opts, IPv6_Route, IPv6_Frag, HIP, MH and the generic
  IPv6_Ext fallback (Shim6) return early in extension mode, before
  _decode_next_layer sets _next. 'x' in such a layer then raised
  AttributeError.
- Hold NoPayload on that path: the upper layer belongs to the enclosing
  IPv6 header.
- Regression tests build the frames in memory, one per class.
@JarryShaw
JarryShaw force-pushed the fix/2487-extension-header-membership branch from 7ceb5d5 to abbc6ca Compare October 31, 2026 03:39
@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 31, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 94.50% (unit tier, Python 3.15, abbc6ca2e, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19677 133 2628 120 98.85%
pcapkit/corekit 2605 74 818 37 96.52%
pcapkit/dumpkit 281 3 100 3 98.43%
pcapkit/foundation 3070 24 1072 26 98.79%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 18066 194 4784 180 98.35%
pcapkit/toolkit 924 36 334 10 95.55%
pcapkit/utilities 502 7 144 5 98.14%
pcapkit/vendor 4449 1854 1020 167 55.11%

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

@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 31, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO (Sonnet, abbc6ca2e). _next = NoPayload() appears once per changed class, only on the extension-mode early return; ESP and AH are untouched; 131 tests pass; the PR merges cleanly onto main.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 31, 2026
@JarryShaw
JarryShaw merged commit 37d87ce into main Oct 31, 2026
62 checks passed
@JarryShaw
JarryShaw deleted the fix/2487-extension-header-membership branch October 31, 2026 05:36
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 31, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 31, 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

Development

Successfully merging this pull request may close these issues.

Membership raises AttributeError on a terminal HOPOPT and other extension-header layers

1 participant