Skip to content

fix(ipv6_ext): give the version gate's message the house form - #2397

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2302-ipv6-ext-version-gate-v2
Oct 27, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2302-ipv6-ext-version-gate-v2

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — bug fix

Description

Closes #2302.

  • Problem: IPv6_Ext's version gate raised "only valid for IPv6, got version=4" — a bespoke tail unlike the <prefix>: <lowercase description>: must be X, not {value!r} form fix(ethernet,pcapng): reject a non-string MAC or EUI address (#2222) #2232/fix(arp): prefix the hardware-address messages and reject a bool with ProtocolError (#2256) #2257 established, and it never named the version that was actually wanted. The same method's docstring quoted the message verbatim for the AH/ESP case, so it was stale by the same edit.
  • Fix: message is now "invalid version: must be 6, not {version!r}".
  • Test: test_version_gate_message_is_in_the_house_form pins the message whole on both routes into the gate — a bare-bytes call and the BytesIO/alias=/extension=True stream form.
  • Fail-without-fix: verified the new test fails on unfixed source with the old message text, passes with the fix.

IPv6_Ext's version gate raised "only valid for IPv6, got version=4" -- a
bespoke tail unlike the <prefix>: <lowercase description>: must be X, not
{value!r} form #2232/#2257 established, and it never named the version
that was wanted. The same method's docstring quoted the message verbatim
for the AH/ESP case, so it was stale by the same edit.

Message is now "invalid version: must be 6, not {version!r}".

Test: test_version_gate_message_is_in_the_house_form pins the message
whole on both routes into the gate -- a bare-bytes call and the
BytesIO/alias=/extension=True stream form.
@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) bug Issues reporting a defect (set by the bug report template; a default, not an assessment) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 27, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at d4d93eff8 (Sonnet). Reproduced the old wording on origin/main via both routes (bare bytes, and the BytesIO/alias=/extension=True stream form), confirmed the new wording matches exactly on this head, and confirmed the docstring Note:'s quoted AH/ESP example is accurate (ESP: invalid version: must be 6, not 4). Repo-wide grep (tracked files + 85 remote branches) found no other reference to the old text. 32 passed/114 subtests (main: 31, discriminating); broader tests/protocols/internet/ clean after generating sample captures; mypy/pylint identical to main.

@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 27, 2026
@github-actions github-actions Bot added this to the PyPCAPKit v1.5 milestone Oct 27, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.67% (unit tier, Python 3.15, d4d93eff8, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19601 880 2620 867 92.12%
pcapkit/corekit 2596 74 818 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 3044 23 1060 25 98.83%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17482 209 4602 178 98.24%
pcapkit/toolkit 914 36 334 10 95.51%
pcapkit/utilities 502 7 144 5 98.14%
pcapkit/vendor 4434 1961 1018 167 52.49%

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

@JarryShaw
JarryShaw merged commit 790e630 into main Oct 27, 2026
68 checks passed
@JarryShaw
JarryShaw deleted the fix/2302-ipv6-ext-version-gate-v2 branch October 27, 2026 22:30
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 27, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues reporting a defect (set by the bug report template; a default, not an assessment) fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(ipv6_ext): IPv6_Ext's version gate reads 'got version=4', not the house form

1 participant