Skip to content

refactor(protocols)!: range-check the registry codes, timestamp counts and byte fields the makers still mask #2676

Closed

Description

@JarryShaw

The #2614 internet group's head left these makers writing masked or clamped values where #2617 says they raise ProtocolError. Measured on that head:

  • Registry codes: IPv4(protocol=256) and IPv6_Route(next=256) write 0x00, as does IPv6-Route's type=256. IPv4's TOS codes raise a bare FieldValueError when too wide and accept True. The codes go through _make_index repo-wide, so a width argument there may be the single fix.
  • IPv4 timestamp option: counts are clamped to 9 (list form) or 4 (dict form) without an error. The dict form's default relies on the clamp, so a fix must keep that default.
  • Fixed-size byte fields: these truncate silently; the CALIPSO checksum writes 300 octets as 2. _make_octets exists for this.
  • MH ipv4_dhcp.mode accepts True; it is a one-bit field, so this may be intended.
  • protocol.rst does not document the refactor(protocols): move shared value pack/unpack helpers into the Protocol utilities #2614 helpers (_make_uint, _make_sint, _read_sint, _uint_size, _make_octets).

Breaking for released makers, as #2614 was.

Activity

  1. added this to the PyPCAPKit v1.6 milestone on Nov 2, 2026
  2. added
    breakingBreaks public-facing behaviour or API (apply alongside the type label)
    refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)
    on Nov 2, 2026
  3. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    Filed from #2677's review. The first bullet, the registry codes, is being folded into #2594's rework, because that change rewrites how make() resolves those codes. The remaining bullets edit files #2677 changes. blocked until #2677 merges.

  4. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Nov 2, 2026
  5. moved this to Blocked in PyPCAPKiton Nov 2, 2026
  6. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    #2677 and #2679 have merged, so this is unblocked. A worker is on it now. Moved from blocked to wip.

  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 Nov 2, 2026
  8. moved this from Blocked to WIP in PyPCAPKiton Nov 2, 2026
  9. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The PR is #2691. A Sonnet review is running.

  10. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 3, 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

    breakingBreaks public-facing behaviour or API (apply alongside the type label)refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions