Skip to content

fix(toolkit): scapy reads TCP behind 6in4 in a later IPv4 fragment #1617

Closed

Description

@JarryShaw

With engine='scapy', TCP is read from behind 6in4 (IPv4 protocol 41) inside a later IPv4 fragment. Under RFC 791, a later fragment's data starts mid-datagram and carries no upper-layer header.

Repro on main (d6f627481): one IPv4 fragment at offset 5 (×8 octets), protocol 41, whose data starts with IPv6/TCP.

Engine IPv4 inputs TCP inputs Trace inputs
default 1 0 0
dpkt 1 0 0
scapy 1 1 1

The same frame with protocol 4 (4in4) gives 0 TCP inputs on every engine.

Cause: scapy binds IPv6 under IP for protocol 41 without frag=0 (its 4in4 and TCP bindings have it). _carrier (pcapkit/toolkit/scapy.py:329-331) walks underlayer without checking frag.

Expected: _carrier returns nothing when an IPv4 layer above has a non-zero fragment offset, as the default engine does.

Found by the #1614 cross-review; I reproduced it. Blocked until #1614 merges, because it edits pcapkit/toolkit/scapy.py.

Activity

  1. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1614 merges, because it edits pcapkit/toolkit/scapy.py.

  2. 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
  3. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1614 merged. A worker is on it together with #1606, since both fix how the scapy adapter finds the TCP carrier.

  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 12, 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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions