Repository navigation
fix(protocols): dissect an IPv6 extension header behind a first fragment as without it (#1539) - #1540
Merged
Merged
Conversation
…ent as without it (#1539) - IPv6._decode_next_layer ended its extension header walk at every Fragment header, so a header behind it went to the upper-layer dispatch, without extension=True or version=6: Shim6 failed IPv6_Ext's version gate, and a zero-filled HIP or a Routing type 3 header raised with no IPv6_Ext to stand in, leaving a Raw leaf and no TCP. The walk now goes on past a first fragment (offset 0), as RFC 8200 section 4.5 puts every header through the upper-layer one there; a later fragment still ends it. - fragment, hdr_len and raw_len keep the split at the first Fragment header, which IPv6 reassembly takes. - IPv6._lookup_exthdr follows the same rule when rebuilding from to_dict, and passes over the fragment key. tests/protocols/internet: 455 passed; IPv6 frames in examples/captures: 247, to_dict digests unchanged.
Contributor
|
Coverage: 90.09% (unit tier, Python 3.14,
Per-file detail: the |
Owner
Author
|
Verdict: GOOD TO GO at
Non-blocking:
Non-first fragments being dissected on |
4 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 changeAdded 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
IPv6._decode_next_layerstopped its extension-header walk at every Fragment header. Whatever came next went to the upper-layer dispatch, which passes neitherextension=Truenorversion=6. Shim6 is registered (toIPv6_Ext), but it failedIPv6_Ext's version gate. A zero-filled HIP header, or a Routing header of type 3, raised in its own parser, and nothing stood in for it. Each one became aRawleaf, so the TCP behind it was never reached.fragment,hdr_lenandraw_lenkeep the split at the first Fragment header, becausetoolkit/pcap.py:116reassembles from it._lookup_exthdrapplies the same rule when it rebuilds fromto_dict(), and skips thefragmentkey. Without that, the rebuild drops the header that follows the Fragment header.The new
tests/protocols/internet/test_ipv6_ext_after_fragment_unit.pygets 8 failures onmain.to_dict()digests of all 247 IPv6 frames inexamples/captures/are unchanged. These selections all pass, run one at a time:tests/protocols/internet, eachtests/protocols/test_*roundtrip*,tests/project,tests/test_docstring_contract.pyandtests/test_tier_guard.py.Closes #1539