Repository navigation
fix(protocols): parser registrars warn only when the entry really changes (#1362) - #1400
Merged
Merged
Conversation
…nges (#1362) - The 14 registrars that store a parser (IPv4, HOPOPT, IPv6-Opts, IPv6-Route, HIP, MH x3, TCP x2, SCTP x3, HTTP/2) tested presence only, so handing back the stored entry warned of an overwrite. They now compare the incumbent with the replacement: an equal entry is a silent no-op and the stored object is kept. - Under #1363 the shipped entry is accepted back after an override, which undoes it; that restore warns, as any real displacement does. - Eleven existing "warns on overwrite" tests re-registered the shipped value; they now overwrite with a different one. New tests/protocols/test_parser_registrar_identity_unit.py: 5 tests over 14 sites; 42 subtests fail on origin/main.
Owner
Author
|
Cross-review verdict on
Nit: sibling class-storing registrars compare with |
Contributor
|
Coverage: 89.44% (unit tier, Python 3.14,
Per-file detail: the |
Merged
3 of 5 tasks
This was referenced Oct 8, 2026
Closed
Closed
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.
isortclean;pylint/mypy(Makefile flags) on the 9 sources: no new mypy errors, pylint adds 3R0801duplicate-code (the shared guard).maketargets not run.make testpasses, and a test case covers the change — the legs below onlyWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1362. Refs #1363.
The 14 parser registrars (IPv4, HOPOPT, IPv6-Opts, IPv6-Route, HIP, MH ×3, TCP ×2, SCTP ×3, HTTP/2) now warn only when the incumbent differs from the replacement; an equal entry is a silent no-op and keeps the stored object. PCAP-NG's four (
register_block/_option/_record/_secrets) are left for the PCAP-NG work in #1398. Thetraceflow.pydumper guard already compares identity after #1376 and is unchanged.Note on #1363: these registrars refuse nothing, so the shipped entry is already accepted back; the ruling here means restoring it after an override warns once (a real displacement) and re-restoring is then silent. No snapshot is needed, unlike the class registrars in #1376.
Probe: re-registering every shipped entry warned 14/14 sites (271 entries) on
origin/main, 0 now.Tests: new
tests/protocols/test_parser_registrar_identity_unit.py, 5 tests × 14 sites. Withorigin/mainsources: 42 subtests fail; the foreign-warns and unregistered-silent guards pass both ways. Eleven existing "warns on overwrite" tests re-registered the shipped value and now overwrite with a different one.run_unittest_leg.py protocols/internet: 552, 0 failures.protocols --exclude protocols/internet: 1009, 0 failures.pytest tests/foundation/traceflow/: 25 passed.pytest tests/project: 399 passed, 1 skipped.