Skip to content

fix(toolkit): the dpkt and scapy engines accept IPv4 headers the default engine rejects #1607

Closed

Description

@JarryShaw

With engine='dpkt' or engine='scapy', an IPv4 header whose options the default engine rejects still produces TCP input. The same defect was fixed for pypcapfile in #1596 / #1600.

Repro on main (c43e9318c): Ethernet, then IPv4 with IHL 6 and one option word, then TCP carrying data. TCP datagrams reassembled:

Option default dpkt scapy
Router Alert, valid (control) 1 1 1
Timestamp, length 2 0 1 1
Loose Source Route, pointer 0 0 1 1

Expected: dpkt and scapy reject the header as the default engine does. #1600 did this for pypcapfile by running the default engine's own IPv4 parser on the header when options are present.

Found by the #1581 worker; I reproduced it. Blocked until #1605 and the #1604 PR merge, because both edit pcapkit/toolkit/dpkt.py and scapy.py.

Activity

  1. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1605 and the #1604 PR merge: both edit pcapkit/toolkit/dpkt.py and 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. moved this to Blocked in PyPCAPKiton Oct 10, 2026
  4. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Widening this: the same gap also covers the IPv4 version field. On main (c43e9318c), plain Ether/IPv4/TCP with a version nibble of 5 gives TCP datagrams of 0 on default and 1 each on dpkt and scapy (version 4: 1/1/1).

    It has the same cause and the same fix as the options case: dpkt and scapy accept an IPv4 header without checking it the way the default engine does. Found by the #1605 cross-review.

    Now blocked only until #1605 merges, because it rewrites the dpkt and scapy TCP helpers this fix edits. #1608 turned out not to touch either file.

  5. changed the title [-]fix(toolkit): the dpkt and scapy engines accept IPv4 headers whose options the default engine rejects[/-] [+]fix(toolkit): the dpkt and scapy engines accept IPv4 headers the default engine rejects[/+] on Oct 10, 2026
  6. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1605 merged as d6f627481. A worker is now fixing this on current main.

  7. 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
  8. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 10, 2026
  9. added a commit that references this issue on Oct 13, 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