Repository navigation
fix(const): the Quick-Start function enums reject 9-15, though the field is 4 bits wide - #1353
Merged
Merged
Conversation
…eld is 4 bits wide RFC 4782 section 3.1 gives the Quick-Start option a four-bit Function field. The vendor templates bounded QSFunction at 0 <= value <= 8, so 9-15 raised ValueError instead of resolving to Unassigned. Widen the bound to 0 <= value <= 15 in both templates, matching the other 4-bit const modules (hip.hit_suite, hip.di, mh.dsmip6_tls_packet), and regenerate both const files from the templates. 16 and up still raise. Closes #1350
Owner
Author
|
Cross-review verdict on
|
Contributor
|
Coverage: 88.96% (unit tier, Python 3.14,
Per-file detail: the |
Owner
Author
|
The red
|
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.
pylintandisort --checkon the touched files, notmake mypy. pylint reports only the existing duplicate-code between the two templates, plus missing method docstrings and_dest_pathaccess in the new test, which follows the house test style.make testpasses, and a test case covers the change (only the modules listed below)What is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1350
RFC 4782 §3.1 gives Quick-Start "a four-bit Function field". The vendor templates set
FLAGto0 <= value <= 8. This PR widens it to0 <= value <= 15, the decimal form thathip/hit_suite,hip/diandmh/dsmip6_tls_packetalready use, and regenerates both const files. Both templates read the localDATAdict (LINK is None), so I rendered them offline by running the vendor class. The unchanged templates reproducemain's const files with no diff, and the fixed ones produce exactly the 2-line diff here.QSFunction(9)andQSFunction(15)raiseValueErrorin both IPv4 and IPv6.<QSFunction.Unassigned: 9>and<QSFunction.Unassigned: 15>, andQSFunction(16)still raisesValueError.FieldValueError: invalid QS function: 15. That failure is fix(ipv6-opts): an unassigned Quick-Start function code fails the whole header #1237/fix(ipv4): an unassigned Quick-Start function code fails the whole header #1322, and this PR leaves it alone.Tests:
tests/const/test_const_qs_function_range_unit.py: 0–15 resolve, -1, 16 and 255 raise, and each const file is byte-identical to its template's rendered output.origin/mainsources written over the four files), it fails 14 subtests (9–15 × 2) and passes 3 tests; with the fix, 3 passed and 40 subtests passed.util/run_unittest_leg.py const: 487 tests, 0 failures, 0 errors.tests/project: 389 passed, 1 skipped.test_quick_start_func_unit,test_ipv4_unit,test_ipv6_extension_unit,test_option_roundtrip_unit,test_const_enum_no_mint,test_tcp_quick_start_response_unitandtest_const_enum_get.