Repository navigation
fix(ipv6-opts): rebuild every MPL seed-id kind from its parsed value (#1185) - #1187
Merged
Merged
Conversation
Contributor
|
Coverage: 88.89% (unit tier, Python 3.14,
Per-file detail: the |
Owner
Author
|
Cross-review verdict on
|
…1185) _make_opt_mpl inferred the S field from seed.bit_length(). With S=0 the reader stores the IPv6 source address as the seed, so rebuilding raised AttributeError; and a 64- or 128-bit seed with a small value was rebuilt with a narrower S, changing the octets. - take S from the parsed seed_type, or a new seed_type keyword, and infer it only when neither is given (an IPv6Address seed means S=0) - reject a missing seed or one wider than its S allows with ProtocolError - widen the MPLOption.seed_id annotation to include IPv6Address - same change in HOPOPT and IPv6_Opts Adds tests/protocols/internet/test_mpl_seed_rebuild_unit.py.
JarryShaw
force-pushed
the
fix/1185-mpl-seed-rebuild
branch
from
October 7, 2026 05:21
4fc32b6 to
e828f35
Compare
Owner
Author
|
Cross-review verdict on
|
Merged
4 of 5 tasks
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
make pylint,make mypy,make isort) — ran pylint/mypy/isort with the Makefile flags on the changed files only; no new findingsmake testpasses, and a test case covers the change — the modules listed below only, not the full suiteWhat is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
Closes #1185.
_make_opt_mpl(HOPOPT and IPv6_Opts) now takesSfrom the parsedseed_type(or a newseed_typekeyword), and infers it only when neither is given. For S=0 the seed is the IPv6 source address and is not written. Before, inferring frombit_length()raised on thatIPv6Address, and a 64/128-bit seed with a small value was rebuilt as S=1. A missing or oversized seed raisesProtocolError. TheMPLOption.seed_idannotation now includesIPv6Address.Probe (
from_dataon every HOPOPT/IPv6_Opts layer inexamples/captures/*): before, 2 of 28 raiseAttributeError(options-ipv6.pcapframes 9 (HOPOPT) and 23 (IPv6_Opts) byinfo.number, in a capture regenerated from this PR's base20438e3ec). After, 0 of 28 raise, and both frames rebuild byte-exactly.Tests: new
tests/protocols/internet/test_mpl_seed_rebuild_unit.pycovers S=0–3 byte-exact rebuild, S=0 inside IPv6 and the rejection cases. Without the fix: 12 failed, 4 passed (16 subtests in total). With the fix: 4 passed, 18 subtests passed.test_option_roundtrip_unit6 passed (no MPLEXPECTED_FAILURESentries),test_ipv6_ext_unit30 passed,test_ipv6_extension_runtime3 passed,test_option_coverage_runtime3 passed,test_declared_length_roundtrip_runtime6 passed,tests/project389 passed / 1 skipped.util/run_unittest_leg.py protocols/internet: 476 tests, 0 failures, 0 errors.