Skip to content

fix(ipv6): a CALIPSO option loses its trailing pad and shrinks its length on rebuild #1403

Closed

Description

@JarryShaw

Describe the bug
A CALIPSO option whose Opt Data Len exceeds 8 + 4×cmpt_len loses its trailing pad on rebuild, and the option length drops with it. The pad is read into a PaddingField sized by calipso_pad_len (pcapkit/protocols/schema/internet/hopopt.py:473, ipv6_opts.py:473). The data class has no field for it, and make never emits it. The RFC 5570 checksum covers that pad.

To Reproduce

  • HOPOPT.from_data(HOPOPT(raw).info) turns 3b01 070c 00000001 00 05 0000 00000000 into 3b01 0708 00000001 00 05 0000 01020000: the length goes from 12 to 8, and a PadN replaces the pad.
  • A non-zero pad gives the same output.

Expected behavior
The option length and pad survive byte-exact.

Reproduced on main at 79949ec3d and found by the PaddingField sweep. Related: #1223, #1232.

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 8, 2026
  2. moved this to Pending in PyPCAPKiton Oct 8, 2026
  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks 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
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