Repository navigation
feat(protocols): verify the IGMP and GRE checksums (#2618) - #2654
Merged
Merged
Conversation
- verify_message in pcapkit.corekit.checksum.internet holds the fragment check ICMPv4.read did inline, for ICMPv4, IGMP and GRE to share; the in_fragment context variable moves there as _in_fragment, its only user - IGMP._verify_checksum records checksum_status for every version, from IGMP.read and IGMPv3.read, over the whole IP payload (RFC 2236 2.5) - IGMP.make and IGMPv3.make compute a checksum they are not given, payload included, under CHECKSUM_COMPUTE - GRE.read verifies the checksum when C is set, and records NOT_COMPUTED when C is clear; GRE.make takes checksum_present to compute one - the data models declare checksum_status; pep.rst, the checksum and contextvars pages and CHECKSUM_VERIFY name IGMP and GRE Tests: IGMP, GRE and verify_message cases fail on main and pass here; the IGMP, GRE, ICMP, checksum and guard modules pass, each alone.
Owner
Author
|
GOOD TO GO at
|
This was referenced Nov 2, 2026
JarryShaw
added a commit
that referenced
this pull request
Nov 2, 2026
…hecksums and PyShark's lost tshark status into 1.6.0 (#2449) - Breaking, in the HTTP entry: building HTTP from fields takes version= and from_data refuses a dict, where 1.5.x built HTTP/1.1 and took one; HTTPv1 refuses preface, which 1.5.x wrote ahead of the message (#2651). The versioned-base entry and the conventions entry point at it. - Folded into the checksum entry: IGMP and GRE verify and compute their checksums, verify_message, GRE's checksum_present, and a cut-short GRE frame reading INVALID (#2654). The contextvars entry drops in_fragment, private to the checksum module and in no release. - Fixed: the PyShark engine absorbs the TSharkCrashException asyncio's lost tshark exit status raises, on every Python (#2642). - No entry for the test-only #2592. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
1 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
feat— adds a featureDescription of your pull request and other information
IGMP and GRE verify their checksums, the Internet ones' complement over their own octets with no pseudo-header, in the same shape as IPv4 and ICMP.
pcapkit.corekit.checksum.internet.verify_message()takes over ICMPv4's fragment-aware branch, and ICMPv4, IGMP and GRE call it. ICMPv4's output is unchanged.make()computes the checksum when none is given.NOT_COMPUTEDwhen it is clear. A newchecksum_presentkeyword onmake()follows L2TPv2'slength_flag.INVALIDand warns withChecksumWarning, and never raises.in_fragmentnow has one reader, so it becomes private there, per the refactor(utilities): a home for the ContextVars shared across the library #2616 rule. It never shipped.Known limit: GRE has no length field, so with verification on, a GRE frame cut short by the snaplen reads
INVALIDinstead ofTRUNCATED. It is documented, and #2653 tracks fixing it.A Sonnet cross-review returned GOOD TO GO. It compared each verdict with an independent RFC 1071 sum and each
make()output with scapy. Captures are identical with verification off.Closes #2618