Skip to content

fix(ipv4): SEC rebuild rewrites a non-conforming Field Termination Indicator #1393

Closed

Description

@JarryShaw

Describe the bug
_make_opt_sec sets each Field Termination Indicator from the octet's position (pcapkit/protocols/internet/ipv4.py:1514-1522). _read_opt_sec only warns about a wrong bit (:800) and does not keep the raw octets. So a SEC option carrying a non-conforming termination bit is normalised on rebuild instead of round-tripping. #1321 fixed the inverted convention but not this.

To Reproduce
from_data round trip, option bytes in → out:

  • 8204ab91 → 8204ab90
  • 82041181 → 82041180
  • 8205118001 → 8205118100

Expected behavior
Parse → rebuild is byte-exact, per the standing round-trip rule. The warning can stay, but the wire bits should survive.

Reproduced on main at 66950b1f2; found by the #1390 cross-review. Blocked until #1390 merges, because both edit protocols/internet/ipv4.py.

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

    @JarryShaw
    OwnerAuthor

    Unblocked: #1390 has merged. One worker is taking #1391, #1392 and #1393 together, because all three edit the IPv4 TS and SEC option code.

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