Repository navigation
fix(toolkit)!: the DPKT, Scapy and PyPCAPFile IPv4 adapters still dismiss DF-set fragments (#3216) - #3220
Open
JarryShaw wants to merge 1 commit into
Open
fix(toolkit)!: the DPKT, Scapy and PyPCAPFile IPv4 adapters still dismiss DF-set fragments (#3216)#3220JarryShaw wants to merge 1 commit into
JarryShaw wants to merge 1 commit into
Conversation
…miss DF-set fragments (#3216) - toolkit.dpkt, toolkit.scapy and toolkit.pypcapfile ipv4_reassembly hand over a fragment (MF set or a non-zero offset) whatever its DF flag, and no whole datagram, as toolkit.pcap._ipv4_fragment does (#2961). - Scapy's zero-length-frame guard goes: the IPv4 layer of defaults Scapy builds for one is no fragment, so the new check dismisses it. - New generated fixture ipv4-frag.pcap: whole datagrams with DF set and clear, a DF-clear datagram in three fragments, one out of order, and a DF-set fragment pair; asserted end to end and for engine parity. - Tests that fed these adapters whole datagrams feed first fragments.
JarryShaw
force-pushed
the
fix/3216-ipv4-adapters-df-fragments
branch
from
November 29, 2026 08:24
004d3cf to
301393b
Compare
Owner
Author
|
Good to go at
|
This branch has not been deployed
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
Put an
xinto every box [ ] that applies to your pull request (like this: [x])Use the Preview tab to see how your pull request will look
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeDescribed the user-visible change below and left its changelog entry to the maintainer, keeping
docs/source/changelog/andCHANGELOG.mdout of the diff, if the change is user-visible: N/A — centralisedWhat 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 elseAlso tick if it regenerates constant or registry tables, members keeping their numeric values (the
constlabel)Description of your pull request and other information
Closes #3216.
ipv4_reassemblyintoolkit.dpkt,toolkit.scapyandtoolkit.pypcapfilehands over a fragment (MF set or a non-zero offset) whatever its DF flag, and no whole datagram, astoolkit.pcap._ipv4_fragmentdoes after fix(foundation)!: keep unfragmented IPv4 datagrams out of IPv4 reassembly's output (#2961) #3210 (Wireshark's rule, ruled on fix(foundation)!: keep unfragmented IPv4 datagrams out of IPv4 reassembly's output #2961). A DF-set fragment pair now reassembles on every engine; a direct caller of these adapters getsNonefor a whole DF-clear datagram, which reassembly already ignored.toolkit.pypcapfile.IPV4_FLAG_DFis now unread; it is a documented module constant outside the adapter, so it is left in place.ipv4-frag.pcap(examples/generators/pcap.py): whole datagrams with DF set and clear, a DF-clear datagram in three fragments delivered out of order, and a DF-set pair.test_reassembly_end_to_end.pychecks its datagrams against the capture and RFC 768's UDP length;test_reassembly_engine_parity.pyholds the PCAP, PCAP-NG, DPKT, Scapy and PyPCAPFile adapters and engines to the same fragments and datagrams.test_dpkt_reassembly_rawbytes_unit.py, the fix(toolkit): dpkt and pypcapfile round a PCAP timestamp twice, so a small ts_sec hands over a float 1 ulp off the default engine's #1668 timestamp module,test_dpkt_raw_null_linktypes_unit.py, and some intest_dpkt_unit.pyandtest_scapy_unit.py) now feed first fragments, so they still check what they did.Tests: the new assertions fail on an
origin/developexport (the three adapters' unit tests and both parity tests; PyPCAPFile on PyPy 3.10 with pypcapfile 0.12.0) and pass here. Coverage of the three modules is unchanged and every changed line is covered.tests/toolkit,tests/foundation,tests/integration,tests/protocols,tests/project,tests/*.pyand the Sphinx-gatedtests/projectmodules pass, but fortest_release_version_check_scripts_1967.py's "the fetch was killed" case, which fails the same way on adevelopexport (this host's shell prints a job number beforeTerminated).