Repository navigation
fix(ipv6-opts): RPL option drops reserved flag bits on rebuild and rejects RFC 6553 sub-TLVs - #1201
Merged
Merged
Conversation
…jects RFC 6553 sub-TLVs - Schema: map the five reserved flag bits, and read the octets past the fixed fields as `sub_tlvs`. - Data: add `RPLFlags.reserved` and `RPLOption.sub_tlvs`. - Reader: accept any Opt Data Len >= 4; below 4 still raises ProtocolError. - Maker: new `reserved=0` and `sub_tlvs=b''` keywords, taken from `opt` when given; Opt Data Len is now 4 + len(sub_tlvs). - Both changes apply to HOPOPT and IPv6-Opts, types 0x23 and 0x63. Closes #1199
Owner
Author
|
Cross-review verdict on
|
Contributor
|
Coverage: 88.91% (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) — run on the 6 touched files: isort and mypy clean; pylint differs from base only by oneunused-argumentper schema, from theTYPE_CHECKING__init__stubmake testpasses, and a test case covers the change — the modules listed below onlyAdded a changelog entry — N/A, added centrally
fix— corrects a defectCloses #1199. HOPOPT and IPv6-Opts, types 0x23 and 0x63: the schema now maps the reserved flag bits and reads
sub_tlvs(Opt Data Len − 4). The data classes gainRPLFlags.reservedandRPLOption.sub_tlvs. The reader accepts any length ≥ 4._make_opt_rpltakesreserved=0andsub_tlvs=b'', so its defaults are unchanged.3b002304010200003b002304000200003b0123060102000000aa000000000000ProtocolError: [OptNo 35] invalid formatsub_tlvs=b'\x00\xaa'3b00230001020000(len 0)ProtocolErrorProtocolErrorConstructor change: both data classes have a new required field. The one existing test that built them without it (
test_ipv6_extension_unit.py) now passesreserved=0, sub_tlvs=b''.Tests: new
test_rpl_option_reserved_subtlv_unit.py: 5 passed, 42 subtests. With the fix reverted: 32 failed.test_rpl_option_unit3 passed;test_ipv6_extension_unit61 passed;test_option_roundtrip_unit6 passed;tests/project389 passed, 1 skipped;run_unittest_leg.py protocols/internet503 tests, 0 failures.