Repository navigation
fix(protocols): a later IPv4 fragment's data is raw, not an upper-layer header (#1553) - #1562
Merged
Merged
Conversation
…er header (#1553) A datagram with a non-zero Fragment Offset now passes no next-layer code to _decode_next_layer, so its data is a Raw leaf with no protocol name, as Wireshark shows it, instead of a bogus UDP/TCP header read from mid-datagram octets. info.protocol, the lengths and packet.payload are unchanged, so reassembly and every round trip are too. First fragments and unfragmented datagrams are still dissected. Mirrors #1552's IPv6 fix for #1545.
4 of 13 tasks
Owner
Author
|
Verdict: GOOD TO GO at
The |
Contributor
|
Coverage: 89.62% (unit tier, Python 3.14,
Per-file detail: the |
5 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
Closes #1553. The IPv4 counterpart of #1552.
IPv4.readpassesNoneas the next-layer code when the Fragment Offset is non-zero, so a later fragment's data is aRawwith no protocol name.info.protocol, the lengths andpacket.payloadare unchanged. First fragments (offset 0, MF set) and unfragmented datagrams are still dissected.-o ip.defragment:FALSE): six hand-built frames, covering first, unfragmented, offset 1/185 and behind options, now matchip:data/ip:udp:dataframe for frame.make(): a later fragment given aUDPobject still writes the UDP octets, byte for byte the same asmain. It now reads back asIPv4:Rawwith no UDP layer, as IPv6 has done since fix(protocols): a later IPv6 fragment's data is raw, not an upper-layer header (#1545) #1552.from_data(info),from_data(info.to_dict())) are identical over all 1,616 frames. IPv4 reassembly is identical over 1,331 datagrams, and over a synthetic out-of-order UDP+TCP fragment train.test_ipv4_later_fragment_raw_unit.py. Onmainit gives 27 failed.test_ipv4_unit.pypinned the old dispatch for an offset of 8 octets: it now assertsNone, and asserts the offset-0 case still dispatches.Gaprow cites fix(protocols): a later IPv4 fragment's data is dissected as the upper-layer header #1553.