Repository navigation
fix(ipv6-opts): RPL option 0x23 raises AttributeError in _read_opt_unassigned - #1198
Merged
Merged
Conversation
…assigned The HOPOPT and IPv6-Opts option registries mapped only RPL_Option_0x63 to the RPL reader and maker. Type 0x23 (the RFC 9008 code) fell through to the unassigned handler, which read schema.data off the RPL schema. Register 0x23 alongside 0x63 in both registries and their docstring tables, and add tests/protocols/internet/test_rpl_option_unit.py. Closes #1196
Owner
Author
|
Cross-review verdict on
|
Contributor
|
Coverage: 88.90% (unit tier, Python 3.14,
Per-file detail: the |
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.
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort) — the tools were run directly, not viamake. They found nothing new: pylint E/W shows only the existing W0613/W0622, mypy reports 0 errors in the two files, isort is clean.make testpasses, and a test case covers the change — only the modules listed below were run.Added a changelog entry — N/A, added centrally
fix— corrects a defectCloses #1196. The
HOPOPTandIPv6_Opts__option__registries mapped onlyRPL_Option_0x63torpl. Type0x23, the RFC 9008 code that theRPLOptionschema already accepts, fell through to'none'. This PR registers0x23in both registries and their docstring tables. The reader and maker already existed.Probe
HOPOPT(io.BytesIO(bytes.fromhex(h)))(same forIPv6_Opts):3b002304…and3b00230001020000→AttributeError: 'RPLOption' object has no attribute 'data'3b00230401020000→RPLOption(type=0x23, id=2, rank=0); the zero-length3b00230001020000→ProtocolError: [OptNo 35] invalid format(same as 0x63)Tests: the new
tests/protocols/internet/test_rpl_option_unit.pygives 3 passed, 10 subtests. With the fix reverted it gives 6 failed (every 0x23 subtest), while the 0x63 controls pass.test_option_roundtrip_unitnow generatesRPL_Option_0x23cases for both families, and they round-trip OK (6 passed, 362 subtests). NoEXPECTED_FAILURESentry was involved.test_ipv6_ext_unit30 passed,test_ipv6_extension_unit61 passed,test_mpl_seed_rebuild_unit4 passed,tests/project389 passed / 1 skipped.run_unittest_leg.py protocols/internet: 498 tests, 0 failures, 0 errors.