Repository navigation
fix(ipv6)!: a CALIPSO option loses its trailing pad and shrinks its length on rebuild (#1403) - #1407
Merged
Merged
Conversation
…ength on rebuild (#1403) The octets Opt Data Len covers past the compartment bitmap were a zero-packing PaddingField with no data-class field, so from_data dropped them, wrote Opt Data Len as 8 + bitmap and padded the header with a PadN. - schema: pad is a BytesField sized by calipso_pad_len, kept as read - data: CALIPSOOption gains a required pad field (HOPOPT and IPv6-Opts) - make: _make_opt_calipso takes pad, writes it and counts it in the length
Contributor
|
Coverage: 89.43% (unit tier, Python 3.14,
Per-file detail: the |
Owner
Author
|
Cross-review verdict on
Follow-up, not blocking: |
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.
make pylint,make mypy,make isort) — ranmypyon the 6 source files andisort --checkon the new test;pylintnot runmake testpasses, and a test case covers the change — ran the modules listed below onlydocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A, added centrallyWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1403
The CALIPSO pad (
schema/internet/{hopopt,ipv6_opts}.py:473) was a zero-packingPaddingFieldwith no data-class field, somakedropped it and wroteOpt Data Lenas8 + bitmap. It is now aBytesField, carried aspadin the data class, written back by_make_opt_calipsoand counted in the length. Same pattern as the TS remainder in #1399.Breaking:
data.CALIPSOOption(HOPOPT and IPv6-Opts) gains a requiredpad: bytesfield;test_ipv6_extension_unit.pybuilds one directly and now passespad=b''.Probe
HOPOPT.from_data(HOPOPT(raw).info)on3b01 070c 00000001 0005 0000 00000000: before3b01 0708 00000001 0005 0000 01020000(length 8, PadN appended), after byte-exact. Same for non-zero pad and cmpt_len 2, both classes.Tests: new
tests/protocols/internet/test_ipv6_calipso_pad_unit.py(zero/non-zero pad, cmpt_len 0/2,make()). With the six sources reset toorigin/mainit fails 14 subtests (the 2 no-pad controls pass); with the fix all pass.run_unittest_leg.py protocols/internet554 OK;test_option_roundtrip_unit.py6 passed;tests/project399 passed, 1 skipped.