Skip to content

fix(internet): parse an IGMPv3 Report cut inside its record list (#2650) - #2662

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2650-igmpv3-cut-report
Nov 2, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2650-igmpv3-cut-report

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — fixes a bug

Description of your pull request and other information

An IGMPv3 Membership Report cut short by the capture parses as IGMPv3 instead of falling back to Raw. A Query cut the same way already did.

A Sonnet cross-review confirmed every byte-exact rebuild across cuts at every offset of seven Report shapes. Queries, TCP SACK, SCTP SACK and HTTP/2 SETTINGS are unchanged. The make() validation it asked for is in this head. test_whole_report_is_not_marked is a control and passes on main.

Closes #2650

A Report the capture cuts short falls back to Raw. Report.records is sized
by the IGMP length, so past the octets present a GroupRecord consumes
nothing, and ListField.unpack refuses it as a loop making no progress.

- GroupRecordListField sizes Report.records by the octets present: the
  record the data ends inside is kept as far as it goes, and Schema.unpack
  records the short read, as for a cut Query. ListField is unchanged, so
  its guard against a loop making no progress still holds.
- IGMPv3.make takes num_group_records, which IGMPv3._make_data passes
  through, so a Report cut to fewer records than its count rebuilds as
  captured. A count that is no int from the records' length to 65535
  raises ProtocolError (#2617).
- Tests: cuts inside a record header and a source list, a whole Report,
  cut Additional Data, the field on bytes and a live stream, the count's
  refusals and edges, the short-read sweep, and TRUNCATED checksum_status.

IGMP, schema, field, sweep and doc-claim modules pass; captures parse
identically to main.
@JarryShaw JarryShaw added this to the PyPCAPKit v1.6 milestone Nov 2, 2026
@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Nov 2, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at cc7ea9734. A Sonnet cross-review confirmed the root cause and the byte-exact rebuild of every cut Report across seven shapes, with no change to other list-bearing protocols. Its one required change, refusing a num_group_records the field or the records cannot carry, is in this head. Each bound is pinned by a test.

@JarryShaw
JarryShaw merged commit 32e82ec into main Nov 2, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this to Done in PyPCAPKit Nov 2, 2026
@JarryShaw
JarryShaw deleted the fix/2650-igmpv3-cut-report branch November 2, 2026 17:06
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 2, 2026
JarryShaw added a commit that referenced this pull request Nov 2, 2026
…ants sweep

#2662 range-checks num_group_records against 0xFFFF, the Number of Group
Records field's maximum (RFC 3376 section 4.2.1), which the one-home sweep
read as a copy of IP_MAX_LENGTH. Key it in NOT_A_COPY by its exact expression.
JarryShaw added a commit that referenced this pull request Nov 2, 2026
…he cut-frame fixes and GRE's bindings into 1.6.0 (#2449)

- Breaking: TCP, UDP and SCTP makers (#2670) and PCAP-NG's (#2671) raise
  on a value a field cannot hold, where 1.5.x wrote it masked; each entry
  gives the old and new values. The TTL Diff wraps as before.
- Changed: __index__ returns the LinkType, EtherType, TransType or AppType
  value, ports as ints (#2652); only Create Release waits for a deployment
  approval (#2658). The conventions entry records the index rule.
- Fixed: a cut HTTP/2 SETTINGS frame parses and rebuilds; HTTPv2.make
  takes frame_length (#2666).
- Folded into unreleased entries: FRAD at LinkType 107 and GRE at IP
  protocol 47 (#2667); cut IGMPv3 messages and num_group_records (#2662,
  #2672); Linux_ARPHRD (#2663); DCCP's range checks (#2670); a cut GRE
  frame is TRUNCATED, replacing fold-12's INVALID note, and frame_length
  in pcapkit.utilities.contextvars (#2668).
- No entry for _make_sint's private allow_unsigned, ARP's private
  PAT_MAC_ADDR, or the test- and docs-only d728873, 326a6cf,
  fc80fb1, a37edf1 and 2766707.
- 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(internet): a truncated IGMPv3 Report falls back to Raw instead of parsing what it carries

1 participant