Repository navigation
fix(protocols): reject an IPv6 header whose Version is not 6 (#1680) - #1723
Merged
Merged
Conversation
- IPv6.read raises ProtocolError("[IPv6] invalid version: N") for any
Version but 6, as IPv4.read does for any but 4; behind Ethernet or a
tunnel the frame stops there, kept raw and rebuilt as captured, where
from_data used to rewrite the first octet to 6
- default engine only; the third-party adapters are unchanged (#1687)
- IPv6.make cannot write another Version, so make->parse is unaffected
- the #1666 module now pins that the default engine hands the Version 4
frames nothing, and checks dpkt and scapy against constants
- add test_ipv6_version_1680_unit and an ipv6/version-4 REJECTED case to
the internet edge round trip; drop toolkit/pcap.py's stale note
No frame of the 23 generated captures changes (1616 frames, 247 IPv6
layers). tests/protocols/internet, tests/toolkit and the project guards
pass on 3.14; the changed modules pass on 3.11.
Closes #1680
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 89.42% (unit tier, Python 3.15,
Per-file detail: the |
3 of 13 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
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 elseDescription of your pull request and other information
Closes #1680.
IPv6.readraisesProtocolError("[IPv6] invalid version: N")for any Version but 6, asIPv4.readdoes for 4 (owner ruling). The default engine only; the adapters are unchanged, per the best-effort ruling on fix(protocols): the default engine accepts an IPv6 Jumbo Payload option of 65535 octets or less, against RFC 2675 #1687.main, rebuilding such a frame wrote Version 6 (60...for40...).IPv6.makealready hard-codes Version 6, so make->parse is unaffected.test_ipv6_version_1680_unit.py, plus anipv6/version-4edge round-trip case. With the check removed, the three changed modules show 78 failures.test_pcap_tcp_segment_ipv6_version_1666_unit.pypinned the old accept-anything reading. It now checks that the default engine reads only the controls, and checks dpkt and scapy against fixed values.tests/protocolsandtests/toolkitpass, as dotests/foundation,tests/integration,tests/interfaceandtests/cli.