Skip to content

fix(toolkit): the pyshark engine traces fragmented TCP at the last fragment, not the first #1612

Closed

Description

@JarryShaw

With engine='pyshark', a TCP segment carried in a fragmented IPv4 datagram is traced at a different frame from the default engine. tshark defragments by default and reports TCP at the frame that completes the datagram. The default engine reads TCP from the first fragment.

Repro on main (c43e9318c), Python 3.11, tshark 4.6.9, on a plain IPv4 capture whose data segments are fragmented. Trace frame indices per flow:

  • default: (1, 2) and (6, 7)
  • pyshark: (1, 5) and (6, 10)

The #1605 review reports the same for IPv6 first fragments; I have not re-measured that.

Expected: pyshark traces the segment at the first fragment, as the default engine does. One untested option is to run tshark with IP reassembly off: preference ip.defragment:FALSE, and the IPv6 equivalent, via pyshark's override_prefs. #1605's tests exclude first fragments from the pyshark comparison for this reason; that exclusion should go when this is fixed.

Blocked until #1605 merges, because it edits pcapkit/toolkit/pyshark.py.

Activity

  1. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1605 merges, because it rewrites pcapkit/toolkit/pyshark.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. moved this to Blocked in PyPCAPKiton Oct 10, 2026
  4. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1605 merged as d6f627481. One worker is now fixing this together with #1611, since both are in the pyshark engine.

  5. 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
  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