Skip to content

fix(reassembly): IPv4 reassembly leaves a TSO datagram (total_length 0) incomplete #1555

Closed

Description

@JarryShaw

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.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 10, 2026
  2. moved this to Blocked in PyPCAPKiton Oct 10, 2026
  3. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    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.

  4. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 10, 2026
  5. moved this from Blocked to WIP in PyPCAPKiton Oct 10, 2026
  6. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 10, 2026
  7. added this to the PyPCAPKit v1.5 milestone on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions