Repository navigation
feat(internet): add IGMPv1/IGMPv2 as concrete classes over an abstract base - #2444
Conversation
|
Coverage: 94.47% (unit tier, Python 3.15,
Per-file detail: the |
|
NEEDS CHANGES (cross-review, different model from the author). Required: (1) a plain Should-fix: wrong Type codes, field layout, checksum fixtures and protocol wiring for v1/v2 all independently confirmed correct. Relaying all three required fixes to the original agent. |
90169ae to
41b5735
Compare
|
All required fixes applied and verified directly (new head |
41b5735 to
d1e4b4e
Compare
|
Auto-resolved conflict (standing rule): #2444 went CONFLICTING against Old head Old head's CI was still early (only 2 check-runs posted, both non-failing) when this landed, so there's no completed-green state to bypass checks against — the rebase just needs its own CI run. |
|
Round 2 verdict: substantively GOOD, one timing note. The reviewer's one "blocker" (head not rebased onto main, CONFLICTING) was reviewed against head All substantive checks passed: Two should-fix items found: the RFC 1112 Appendix I citation has no working Noted for later: all three sibling wave-2 PRs will conflict with this one on |
d1e4b4e to
ce2f5e6
Compare
|
Both should-fix items applied and verified directly (new head |
ce2f5e6 to
63a93e7
Compare
|
Re-resolved the conflict (my own process gap this time, not the worker's): the previous fix-relay agent amended the branch inside the live worktree, which still held the pre-rebase history — my earlier out-of-band rebase (pushed from a separate scratch worktree) never got synced back into the live one, so that agent's force-push silently reverted it, and Old head |
|
Confirmed by direct diff: content at new head |
|
No, |
|
My reading of your 03:49Z comment: the IGMP base stays abstract and non-instantiable. The rework repoints the |
|
Held: Actions queue at 50 (above the hold line). The rework dispatches when the queue drops below 40. |
|
Member order is in scope for this rework. Group the class body as: properties, public methods ( |
|
Rework pushed as Decision needed: |
|
hmm, in this case, sounds like we'd still need a dispatcher logic then. |
|
My reading of your 04:44Z comment: the IGMP registry entry needs dispatch logic to choose between IGMPv1 and IGMPv2, so the earlier no-dispatcher direction is reversed for this case. This is a rework: #2444 goes back to needs-changes, held until the Actions queue is below 40. |
|
Held: Actions queue at 78 (well above the hold line). The dispatch rework dispatches when the queue drops below 40. |
|
My reading of your ruling: |
|
GOOD TO GO (Sonnet, |
|
|
|
My reading of your 05:51Z comment: |
|
Decision needed: IGMP dispatcher. Options: (a) the IGMP base carries the version dispatcher, as origin da17ab0 does now; (b) no dispatcher, use dynamic properties and log/error messages, per your 02:15Z comment. Recommendation: (a). TransType cannot tell IGMPv1, v2 and v3 apart, so the base has to dispatch. This also unblocks #2465 and #2448. |
|
take (a). IGMP is having a similar situation as HTTP, where we cannot tell the exact versions from the registered enum value, so a dispatch at the base class is required. but (b)'s work can be partly taken if applicable. |
|
NEEDS CHANGES (Sonnet, |
|
Hold, not pushed. The base |
|
GOOD TO GO (Sonnet, |
…patch - igmp.py: IGMP is abstract (version is an abstract property) and never instantiated. It holds the schema, data model, read and make; _classify places a message in a version (a Query is v1/v2 only at 8 octets). _dispatch picks IGMPv1 or IGMPv2 from the type and max response time, else Raw. - internet.py: TransType.IGMP is registered against the IGMP base, and _next_layer_class dispatches it through IGMP._dispatch. - igmpv1.py / igmpv2.py: concrete classes returning version 1 / 2; id() is the family and version, alias is dynamic from version. - Schema, data model, IANA Type registry, docs, dispatch generator and tests added.
- igmp.py: make() checks type and max_resp_time in one loop and refuses bool for both, replacing the separate max_resp_time bool check. - test_igmp_unit.py: make(type=True/False) raises ProtocolError.
- Add id() to the abstract IGMP base, in the Methods group before read(),
returning ('IGMP', 'IGMPv1', 'IGMPv2'). The base previously inherited
Protocol.id() and reported only ('IGMP',).
- IGMPv1 and IGMPv2 keep their narrowed ids.
- Test: the base id names both versions; each version narrows it.
Fails on 43c8a75 (base id), passes here. Narrow run:
pytest tests/protocols/internet -k igmp, 39 passed.
An earlier rebase resolved pep.rst's conflicts by 'merging both sides' and reintroduced stale text that main had already corrected, plus left two broken cross-references: - LINUX_SLL/LINUX_SLL2 were re-added to the Link Layer outstanding list even though main already removed them once #2438 landed, and a contradictory 'now implemented' clause was appended describing them as still outstanding one sentence earlier. - IGMP stayed listed as outstanding on the Internet Layer and among the real-capture gaps, despite this PR implementing it. - igmpv1.IGMPv1 and igmpv2.IGMPv2 don't exist; both modules export a class literally named IGMP. Fixed the cross-references to use explicit display text over the real igmpv1.IGMP/igmpv2.IGMP targets. Verified: test_conventions_doc_claims.py passes clean (34 tests, 259 subtests); IGMP and dispatch-registry narrow tests unaffected (47 tests, 194 subtests).
|
Pushed
Verified: |
IGMP adds pcapkit/const/igmp/type.py, but the pin bumps across the 4 census test files were missing. Bumped: ints 117->118, enums 133->134, distinct modules 127->128 (test_const_enum_builtin_parity); enums 123->124, covered 120->121 (test_const_enum_get); enums 117->118 (test_const_enum_lookup); all_files 127->128, generated 110->111 (test_const_registry_protocol). Verified: tests/const/, tests/vendor/, test_igmp_unit.py, test_dispatch_registry_unit.py and test_conventions_doc_claims.py all pass clean (661 tests, 27092 subtests).
|
Cross-review (Sonnet) at |
|
Cross-review (Sonnet) at |
Summary
IGMPbase (feat(internet): implement IGMP v1/v2 (v3's group-record list as a follow-up) #2439).IGMPis not instantiable:versionis abstract on the base;IGMPv1andIGMPv2return 1 and 2.TransType.IGMPpoints atigmpv2.IGMP. IGMPv1 messages on IP protocol 2 fall back to Raw.Test plan
tests/protocols/internet/test_igmp_unit.py,tests/protocols/test_dispatch_registry_unit.py: 40 passed, 169 subtestsexamples/generators/make_samples.pyruns cleaninternet.pyfails isort onmainas welligmp.py: C0301, R0913/R0917 onmake, W0622 on_classify'stype