Skip to content

fix(ipv6-opts): _make_opt_smf_dpd overwrites the parsed DPD mode, so H-DPD rebuilds as I-DPD #1190

Closed

Description

@JarryShaw

Describe the bug
_make_opt_smf_dpd drops the parsed DPD mode. It sets dpd_type = opt.dpd_type (pcapkit/protocols/internet/hopopt.py:1606) and then overwrites it at :1611 from the mode keyword, whose default is I-DPD. A parsed H-DPD option therefore rebuilds as I-DPD. ipv6_opts.py has the same code.

To Reproduce
On origin/main, build an H-DPD SMF_DPD option (mode=H_DPD, hav=01020304), parse it, and rebuild it with from_data. The original bytes are 3b00080481020304. The rebuild is 3b00080100010100: I-DPD with a null tagger ID. HOPOPT and IPv6_Opts behave the same.

Expected behavior
A parsed SMF_DPD option keeps its mode and rebuilds byte-exactly.

Found by the #1187 worker. The #1187 cross-review reproduced it. I read both lines on main.

Activity

  1. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1187 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: #1187 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. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 7, 2026
  6. added this to the PyPCAPKit v1.5 milestone on Oct 25, 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