You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
IPv4 reassembly turns every TSO datagram (total_length 0) into an incomplete one with no payload, under every engine.
Reproduction
Take examples/captures/tcp.pcap with the IPv4 frames' total_length set to 0, and run extract(..., ipv4=True, reassembly=True) on #1554's head (821aa1003):
default engine: 4 × PARTIAL, payload None;
dpkt engine: 4 × PARTIAL, payload None;
unmodified capture: 4 × COMPLETE, payloads of 44, 32, 244 and 32 octets.
I ran this myself.
Expected behavior
The same COMPLETE datagrams as the unmodified capture. A datagram with total_length 0 and DF clear is unfragmented, and its payload is the rest of the frame (#1547).
System information
Linux, CPython 3.14.7, #1554 at 821aa1003.
Additional context
The adapters pass tl=ipv4.len, which is 0 (toolkit/pcap.py:70, toolkit/dpkt.py:537, toolkit/scapy.py:256, toolkit/pypcapfile.py:492). foundation/reassembly/ip.py:155 then computes length = TL - IHL = -20, and :195 sets TDL from it. info.len must stay 0 so the round trip holds, so the fix belongs in reassembly or the adapters.
Found by the #1554 author. This issue is blocked until #1554 merges, because the TSO payload it relies on is new there.
Unblocked: #1554 has merged, so a TSO frame now parses its payload. A worker is on the fix in pcapkit/foundation/reassembly/ip.py, the one shared site. The four toolkit adapters stay as they are, because other open PRs are editing them.
Activity
JarryShaw commentedon Oct 10, 2026
Unblocked: #1554 has merged, so a TSO frame now parses its payload. A worker is on the fix in
pcapkit/foundation/reassembly/ip.py, the one shared site. The four toolkit adapters stay as they are, because other open PRs are editing them.fix(reassembly): a TSO fragment's length is its captured length, and …
fix(reassembly): a TSO fragment's length is its captured length, and …
fix(reassembly): a datagram too long for its length field never compl…
fix(reassembly): a datagram too long for its length field never compl…