Repository navigation
fix(ipv6): _read_ip_hextet slices include the version nibble - #1109
Merged
Merged
Conversation
The traffic class was read from hex[0:2] and the flow label from hex[2:], so both included the version nibble. Read them from hex[1:3] and hex[3:]. Correct the pinned values in test_ipv6_unit.py, and add test_ipv6_read_ip_hextet_unit.py, which also checks the helper against the schema's own packing. Closes #1094
Owner
Author
|
Cross-review verdict on
|
Contributor
|
Coverage: 88.74% (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.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A, added centrally after the waveWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1094.
IPv6._read_ip_hextetread the traffic class fromhex[0:2]and the flow label fromhex[2:], so both included the version nibble. It now reads them fromhex[1:3]andhex[3:]. The parser has used the schema since45ebc600d, so the helper's only caller is a test, and that test pinned the wrong values. I fixed the method rather than deleting it because it is a method on a public class. The bug was first reported in #389 and was never filed.Probe (
6abcdef0): before(6, 0x6a, 0xbcdef0), after(6, 0xab, 0xcdef0).Tests: I corrected the pinned values at
test_ipv6_unit.py:131. The new moduletest_ipv6_read_ip_hextet_unit.pychecks the issue's bytes, and also checks the helper against the bytes thatIPv6.make(...).pack()produces.2 failed,test_ipv6_unit.py1 failed, 9 passed.2 passedand10 passed, 5 subtests passed.tests/project:379 passed, 1 skipped, 1285 subtests passed.ipv6.py. None of their findings are on the edited lines. Every finding is in code this PR does not change.