Skip to content

fix(protocols): IPv6.read accepts a header whose Version is not 6 #1680

Closed

Description

@JarryShaw

Question, carried over from #1666, which #1675 fixed and closed: should IPv6.read reject a header whose Version is not 6?

Today. IPv6.read copies the Version nibble without checking it (pcapkit/protocols/internet/ipv6.py:206), although Data_IPv6.version is typed Literal[6] (pcapkit/protocols/data/internet/ipv6.py:38). IPv4.read rejects any Version but 4 (pcapkit/protocols/internet/ipv4.py:296), and tshark stops at "Bogus IPv6 version".

Measured with a runtime patch on #1666's survey: rejecting Version ≠ 6 would drop the default engine's inputs on rows 1-8 and 15. TCP and trace inputs would go to 0/0, and row 15 would lose its IPv6 reassembly inputs. The H4 controls would also lose theirs: a first fragment, a later fragment, and H4 carrying IPv4. dpkt and scapy hand all of these over, so agreement would need the same change in every engine.

Options:

  1. Keep accepting any Version (today's behaviour). The engines agree as they are.
  2. Reject Version ≠ 6 in IPv6.read, as IPv4.read does, and make dpkt, scapy and pypcapfile stop there too.

Activity

  1. added
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Oct 13, 2026
  2. moved this to Needs decision in PyPCAPKiton Oct 13, 2026
  3. JarryShaw commented on Oct 13, 2026

    @JarryShaw
    OwnerAuthor

    If the version is not 6, it should reject. Each concrete protocol class should focus only on itself. Only those abstract protocol classes with dispatcher logic can handle multiple concrete protocols.

  4. JarryShaw commented on Oct 13, 2026

    @JarryShaw
    OwnerAuthor

    Recorded: IPv6.read rejects a Version other than 6, as IPv4.read rejects anything but 4. Each concrete protocol class handles only itself, and only the abstract dispatcher classes route between protocols. Retitled as a fix.

    Every engine has to stop at the same place, or the change opens new disagreements. On these frames, dpkt, scapy and pypcapfile would hand over inputs while the default engine hands over none. tshark already stops at "Bogus IPv6 version". So this lands as one PR covering IPv6.read and each engine's adapter.

    Blocked until the open work on those engine files merges: the PRs for #1667 (pypcapfile), #1676 (scapy) and #1671 (pyshark).

  5. changed the title [-]question: should IPv6.read reject a header whose Version is not 6?[/-] [+]fix(protocols): IPv6.read accepts a header whose Version is not 6[/+] on Oct 13, 2026
  6. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    fixPull requests that fix a defect (fix: subject prefix)
    and removed
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Oct 13, 2026
  7. moved this from Needs decision to Blocked in PyPCAPKiton Oct 13, 2026
  8. JarryShaw commented on Oct 13, 2026

    @JarryShaw
    OwnerAuthor

    #1682 (pypcapfile) and #1683 (scapy) have merged. This is now blocked only on the PR for #1671 (pyshark), which a worker is writing.

  9. JarryShaw commented on Oct 14, 2026

    @JarryShaw
    OwnerAuthor

    Its pyshark blocker, #1686, has merged. Two others now hold it, because this lands as one PR across every engine adapter: #1690 (open) edits the dpkt and pypcapfile adapters, pcapkit/toolkit/dpkt.py and pcapkit/toolkit/pypcapfile.py, and the #1626 worker is editing pcapkit/toolkit/pyshark.py. Blocked until #1690 and the PR for #1626 merge.

  10. JarryShaw commented on Oct 14, 2026

    @JarryShaw
    OwnerAuthor

    #1690 has merged. This is now blocked only on the PR for #1626, whose worker is editing pcapkit/toolkit/pyshark.py.

  11. JarryShaw commented on Oct 14, 2026

    @JarryShaw
    OwnerAuthor

    Re-scoped under the best-effort ruling on #1687: IPv6.read rejects a Version other than 6 in the default engine only, and the adapters stay as they are. That removes the pyshark blocker. It now waits only on the #1687 PR, which edits IPv6.read's jumbogram handling in the same file, pcapkit/protocols/internet/ipv6.py. Blocked until the #1687 PR merges.

  12. JarryShaw commented on Oct 14, 2026

    @JarryShaw
    OwnerAuthor

    The #1687 PR is #1713. This stays blocked until it merges.

  13. JarryShaw commented on Oct 14, 2026

    @JarryShaw
    OwnerAuthor

    #1713 has merged, so this is unblocked. A worker is on it: IPv6.read rejects a Version other than 6 in the default engine only, as recorded above.

  14. 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 14, 2026
  15. moved this from Blocked to WIP in PyPCAPKiton Oct 14, 2026
  16. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 14, 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