Skip to content

fix(tcp): from_data reorders and re-pads TCP options #1151

Closed

Description

@JarryShaw

Describe the bug
from_data rebuilds the TCP options of examples/captures/tcp.pcap in a different order and with different padding, so the segment does not round-trip byte for byte.

Expected behavior
Options keep their wire order and padding through from_data.

Blocked until
#1135 merges, because it edits pcapkit/protocols/transport/tcp.py.

Additional context
Found by the #1126 worker. Not yet reproduced independently.

Activity

  1. 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 6, 2026
  2. JarryShaw commented on Oct 6, 2026

    @JarryShaw
    OwnerAuthor

    Root-cause detail from #1150: TCP._make_tcp_options (tcp.py:2029-2116) drops the original NOP/EOOL octets as "padding" and pads each option to 4 octets separately. Options therefore come back reordered and longer. On http.pcap the data offset goes from a0 to b0, and the IPv4 total length grows by 4.

    A sweep found this in http.pcap, many_interfaces.pcapng, test.pcap and tcp.pcap.

  3. JarryShaw commented on Oct 6, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1135 merged at 22:31Z, so tcp.py is free. A worker is on it now; it will reproduce the reorder/re-pad independently first, since this was not yet confirmed.

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