Skip to content

fix(ipv6-opts): RPL option drops reserved flag bits on rebuild and rejects RFC 6553 sub-TLVs #1199

Closed

Description

@JarryShaw

Describe the bug
_read_opt_rpl and _make_opt_rpl in HOPOPT and IPv6_Opts have two gaps that predate #1198. Both apply to type 0x23 and type 0x63.

  1. Reserved flag bits are dropped. Only O, R and F survive the read and the maker, so 3b00230401020000 rebuilds through from_data as 3b00230400020000. The rebuild is byte-exact only when the reserved bits are 0.
  2. Sub-TLVs are rejected. hopopt.py:1006 and ipv6_opts.py:995 raise ProtocolError unless the option length is exactly 4. RFC 6553 §3 makes the length variable and says unrecognised sub-TLVs MUST be skipped. For example, 3b0123060102000000aa000000000000 gives ProtocolError: HOPOPT: [OptNo 35] invalid format.

Expected behavior
Reserved bits round-trip unchanged. An option longer than 4 octets parses, and its sub-TLV bytes are kept so that the rebuild is byte-exact.

Found by the #1198 cross-review. I re-ran both inputs on the #1198 branch.

Activity

  1. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1198 merges, because both edit hopopt.py and ipv6_opts.py.

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

    @JarryShaw
    OwnerAuthor

    Unblocked: #1198 merged. A worker is on it now.

  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 7, 2026
  5. added a commit that references this issue on Oct 7, 2026
    11ae68e
  6. 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