Skip to content

fix(protocols): two octets of option padding are written as two Pad1 options, not one PadN #1793

Closed

Description

@JarryShaw

Describe the bug
For two octets of padding, the padding builders emit two Pad1 options:

  • pcapkit/protocols/internet/hopopt.py:1369-1372
  • pcapkit/protocols/internet/ipv6_opts.py:1358-1361
  • pcapkit/protocols/internet/mh.py:7755-7758

_make_pad_options(6) returns [Pad1, Pad1] on each. RFC 8200 §4.2 says PadN "should be used, rather than multiple Pad1 options", and RFC 6275 §6.2.2 says the same for Mobility options. The code already parses a two-octet PadN with length 0.

Expected behavior
Two octets of padding become one PadN with length 0; one octet stays a Pad1. The builders' docstrings, which state the two-Pad1 behaviour, follow.

Additional context
Low severity: a SHOULD, so the output is still valid. Found by the #1103 second pass (internet slice) and confirmed by a Sonnet review. #354 is a different PadN defect.

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

    @JarryShaw
    OwnerAuthor

    Blocked until #1798 merges; it edits the docstrings of hopopt.py, ipv6_opts.py and mh.py, which this fix also changes.

  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 15, 2026
  4. JarryShaw commented on Oct 15, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1798 has merged. A worker is on it.

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