Repository navigation
fix(internet): narrow IGMP's id() to self, per owner's post-merge ruling - #2506
Conversation
Follow-up to the owner's ruling on this fix: IGMPv1 (RFC 1112) should take the same shape as ICMPv4 (PR #2446) -- its RFC's own name carries no version, so id() and alias both drop it, rather than narrowing to a versioned 'IGMPv1' name that RFC 1112 never uses. - IGMPv1.id() -> ('IGMP',), IGMPv1.alias -> 'IGMP'. - IGMPv2.id() -> ('IGMPv2',) and IGMPv2.alias -> 'IGMPv2', unchanged: RFC 2236 names IGMPv2 with its own version, so it keeps the shape from the first round of this fix. - IGMP.id() (the family base) -> ('IGMP', 'IGMPv2'), the family-inclusive shape, since IGMPv1's canonical name and the family's own name are now the same string -- the same shape ICMP.id() takes, ('ICMP', 'ICMPv6'). - igmp.py's shared read() error message kept the version-specific 'is not an IGMPv1/IGMPv2 message' wording explicit, decoupled from alias, so the error stays as informative as before despite the alias change. Selector matching for the bare 'IGMP' and 'IGMPv1' strings is unaffected -- 'IGMPv1' still has its own registry key independent of id(), the same mechanism ICMPv4 relies on for 'ICMPv4'. Promoted the ICMPv4 doc text from 'a proposal, not a ruling' to a settled ruling (PR #2446 shipped exactly this shape), and recorded IGMPv1's matching case alongside it. Verified: tests/protocols/internet/test_igmp_unit.py (39 tests), test_dispatch_registry_unit.py, test_conventions_doc_claims.py and test_public_api.py all pass clean (91 tests, 1163 subtests).
5d918b1 to
711141b
Compare
|
Pushed
Also promoted Verified: |
|
Cross-review (Sonnet) at |
|
Coverage: 94.47% (unit tier, Python 3.15,
Per-file detail: the |
…ow-to-self # Conflicts: # pcapkit/protocols/internet/igmp.py # tests/protocols/internet/test_igmp_unit.py Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
Post-merge correction to #2444, per owner ruling: IGMPv1/IGMPv2 shipped with the family-inclusive
id()shape (('IGMP', 'IGMPv1')), but the ruling is that IGMP narrows to self, like IP/IPsec's AH and ESP.IGMP.id()->('IGMPv1', 'IGMPv2')(members only, drops the family name)IGMPv1.id()->('IGMPv1',),IGMPv2.id()->('IGMPv2',)Selector matching for the bare
'IGMP'string is unaffected -- it resolves via the registry key's own expansion, the same mechanism that already makes'IPsec'select an AH or ESP layer. Verified directly against a real parsed IGMPv1 layer.Recorded the ruling in
protocol-family-grouping.rst, which previously had no IGMP entry.Build and test:
tests/protocols/internet/test_igmp_unit.py,test_dispatch_registry_unit.py,test_conventions_doc_claims.py,test_public_api.pyall pass clean (91 tests, 1163 subtests).