Repository navigation
fix(hip): Locator flags drop the seven bits other than Preferred on rebuild - #1367
Merged
Merged
Conversation
…ebuild - schema: Locator.flags names `reserved: (0, 7)` beside `preferred: (7, 1)`, per RFC 8046 section 4 and the #654 per-site policy. - data: Locator gains `reserved`, read verbatim from the flags octet. - make: `_make_locator` writes `reserved` (from the data model, or the `reserved` keyword, default 0). - test_hip_unit, test_hip_locator_set_length_unit: Locator fixtures gain the new field. - new test: tests/protocols/internet/test_hip_locator_flags_unit.py. Closes #1365
JarryShaw
force-pushed
the
fix/hip-locator-flags-1365
branch
from
October 7, 2026 20:52
45f80d9 to
696330e
Compare
JarryShaw
marked this pull request as ready for review
October 7, 2026 20:52
Owner
Author
|
Cross-review verdict on
Nit: RFC 8046 says reserved bits are ignored when received. Carrying them verbatim is the round-trip policy rather than an RFC requirement, and the breaking-change note could say that. |
Contributor
|
Coverage: 88.97% (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.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (pylint/mypy/isort with the Makefile flags on the four changed files; no new findings)
make testpasses, and a test case covers the change (only the modules listed below)Added a changelog entry — N/A, added centrally
What is the purpose of your pull request?
fix— corrects a defectCloses #1365
Locator.flagsnow namesreserved: (0, 7)besidepreferred: (7, 1)(RFC 8046 §4: Reserved 7 bits, then P).data.Locator.reservedcarries it;make()writes it from the data model or areservedkeyword (default 0). Breaking:data.internet.hip.Locatorhas a new required fieldreserved, placed afterpreferred, solifetimeandlocatorshift positionally (everyData_*in the repo is built by keyword); a hand-builtschema.Locatormust now passflags={'reserved': …, 'preferred': …}.0xfe,from_datarebuild0x000xfe0xff/0x80/0x550x01/0x00/0x01Fixtures:
test_hip_unit.pyandtest_hip_locator_set_length_unit.pybuildLocatorschemas and data models by hand against the old one-field shape, so they gain'reserved': 0/reserved=0(7 lines, mechanical; no assertion changed).Tests: new
test_hip_locator_flags_unit.py3 passed; withorigin/mainsources written over the fix, 7 subtests fail (0 != 254,1 != 255, …).test_hip_roundtrip_unit6,test_hip_unit34,test_hip_locator_set_length_unit6 passed;tests/project389 passed / 1 skipped;run_unittest_leg.py protocols/internet532 tests, 0 failures.