Skip to content

fix(protocols): rebuild a cut header at the width its parse read it (#2761) - #2777

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2761-parse-width
Nov 4, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2761-parse-width

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — corrects a defect

Description of your pull request and other information

This closes the last #2761 gap, following option (a) as ruled on the issue. A cut IPv6_Ext parsed at 1 octet rebuilt at the 2 octets make() packs, because the data model never recorded the width the parse was given.

Closes #2761

…2761)

A cut header's rebuild was read at the width make() packs, so an IPv6_Ext cut at
one octet, whose length is the width its parse was given, rebuilt with a length
of two.

- Data: a __short_width__ key, carried by to_dict() and left out of repr and the
  dumps, records the length the parse read a cut header at.
- keep_short_read records it beside __short_read__, from the length each layer
  base passes on; Protocol.from_data reads the rebuild at it.
- It replaces Protocol._uncaptured and _short_of_header: read at its parse's
  width, the rebuild leaves its next layer the length its parse did.
- The #2767 sweep drops its known gap; the IGMPv3 direct-vs-IPv4 tests set the
  width aside, each read at its own; utilities-or-corekit.rst records the ruling.

The new tests fail without the fix; every sample capture rebuilds unchanged.
@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 Nov 4, 2026
@JarryShaw JarryShaw added the review: running A cross-review is in flight against the current head - no verdict yet label Nov 4, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 4, 2026
@github-actions github-actions Bot added this to the PyPCAPKit v1.6 milestone Nov 4, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at d47825a51 (Sonnet cross-review, and my own run of the new and adapted cases)

@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 Nov 4, 2026
@JarryShaw
JarryShaw merged commit b3d78f4 into main Nov 4, 2026
68 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Nov 4, 2026
@JarryShaw
JarryShaw deleted the fix/2761-parse-width branch November 4, 2026 19:03
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 4, 2026
JarryShaw added a commit that referenced this pull request Nov 4, 2026
- #2777: the cut-header sentence reads the length back too, the rebuild read
  at the width its parse was given (__short_width__); the ruling into the
  conventions entry.
- #2778: a PCAP-NG block with octets after opt_endofopt rebuilds an info
  holding its options and padding_opts, where 1.5.1 rebuilt none, into the
  whole-header rebuild entry; 1.5.0's frozen entry is left as written.
- #2779: SCTP's reorder, the source-ordered member lists and the sorted
  Option.register clash warning ('opt', 'if', 'epb', ... in 1.5.1), into the
  member-order entry; the layer-grouped registry and the warning name restore
  ('put back silently' in 1.5.1), into the #2770 entry; the page wording into
  the conventions entry.
- #2781: import_lock serialising first resolutions, into the lazy-import
  entry; the removed registry lock never shipped and stays unnamed.
- CHANGELOG.md regenerated; util/changelog_md.py --check passes.
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.

fix(protocols): a cut standalone IPv6 extension header rebuilds with values its parse did not read

1 participant