Repository navigation
fix(protocols)!: pad two octets with one PadN, not two Pad1 (#1793) - #1812
Merged
Merged
Conversation
HOPOPT, IPv6-Opts and MH each filled a two-octet alignment shortfall with two Pad1 options. RFC 8200 section 4.2, and RFC 6275 section 6.2.2 for mobility options, say a PadN should be used rather than multiple Pad1. - `_make_pad_options` in hopopt.py, ipv6_opts.py and mh.py: two octets are now one PadN of length 0 (`01 00`); one octet stays a Pad1 and three or more keep the PadN they had. Docstrings follow. - Parsed padding is untouched: a header carrying two Pad1 still rebuilds byte for byte, since parsed options are re-emitted as read. - Tests: new test_padn_two_octets_1793_unit pins the helper and the built headers for all three protocols, plus the two-Pad1 parsed rebuild; the fresh-build pins in five existing modules move to `01 00`. Closes #1793
Owner
Author
|
Verdict: GOOD TO GO at |
Contributor
|
Coverage: 89.60% (unit tier, Python 3.15,
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 (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What 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 elseSummary
For two octets of padding, the HOPOPT, IPv6-Opts and MH padding builders emitted two
Pad1options. RFC 8200 §4.2, and RFC 6275 §6.2.2 for Mobility options, say a PadN should be used rather than multiple Pad1 options._make_pad_options(hopopt.py,ipv6_opts.py,mh.py; they share no helper), only one octet gives aPad1. Two octets become aPadNof length 0 (01 00), and three or more are unchanged. The builders' docstrings cite the RFCs.Pad1options still rebuilds byte for byte.tests/protocols/internet/test_padn_two_octets_1793_unit.pyfails onmainfor all three protocols. Existing fresh-build byte pins move to01 00; parsed-frame pins are unchanged.tests/protocols/internet, the option and capture round-trip suites, andtests/projectpass.Closes #1793