Skip to content

fix(ipv4): the TS option zeroes the timestamp slots beyond the pointer on rebuild #1349

Closed

Description

@JarryShaw

Describe the bug
The TS option's ts_data covers only pointer - 5 octets; the rest is a PaddingField that packs zeros (pcapkit/protocols/schema/internet/ipv4.py:321 and :326). Slots at or beyond the pointer are data the option carries, and they are lost. Same shape as #1319, which covers LSR/SSR/RR but not TS.

To Reproduce
Parse an IPv4 header carrying the option, then IPv4.from_data(p.info); option bytes in -> out:

  • pointer 5: 440c0500 0000000100000002 -> 440c0500 0000000000000000
  • pointer 9: 44100900 000000010000000200000003 -> 44100900 000000010000000000000000 (slots 2 and 3 of the pre-specified area lost; slot 1 kept)

Expected behavior
The bytes at or beyond the pointer survive the round trip.

Reproduced on main at c9676c5 with /tmp/rtissues/followups-repro.py (check D1).

Found by the PR cross-review follow-up round-trip audit (#1202). The repro was re-checked by an independent verifier, and I re-ran it on main at c9676c563.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  2. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1344 merges, because both edit protocols/schema/internet/ipv4.py and internet/ipv4.py (the TS sites are schema/internet/ipv4.py:321 and :326). #1344 fixes the same zero-fill for LSR/SSR/RR (#1319), so this should follow its shape.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  4. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1344 has merged. A worker is starting on the TS sites.

  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 7, 2026
  6. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 8, 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