You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ipv6-opts): zero-length SMF_DPD option parses as H-DPD by reading the next option's type octet #1200
Describe the bug
In HOPOPT and IPv6-Opts, an SMF_DPD option with Opt Data Len 0 parses as H-DPD instead of being rejected, so it cannot be rebuilt.
The H-DPD/I-DPD bit is taken from the forward-matched next octet, which here belongs to the following option. That octet is read twice: once as this option's mode bit, and again as the type of the next option. The parsed option reports length=2 with hav=b''.
To Reproduce
On origin/main (630f0a581):
HOPOPT(io.BytesIO(bytes.fromhex('3b00080080000000'))) parses SMFHashBasedDPDOption(length=2, hav=b'') followed by UnassignedOption(type=0x80).
HOPOPT.from_data(p.info) then raises ProtocolError: … empty Hash Assist Value (HAV).
The I-DPD form with length 0 already raises FieldValueError: invalid SMF I-DPD option length: 0.
Expected behavior
A zero-length SMF_DPD option raises FieldValueError in both modes, so a malformed option is never parsed into something that cannot be rebuilt.
Found during the #1194 cross-review. I re-ran it on main.
Activity
JarryShaw commentedon Oct 7, 2026
Blocked until #1199 merges, because both edit the HOPOPT/IPv6-Opts protocol and schema files.
JarryShaw commentedon Oct 7, 2026
Unblocked: #1201 merged. Held while the internet-v6 round-trip audit runs, so this fix can land together with any related HOPOPT/IPv6-Opts findings.
JarryShaw commentedon Oct 7, 2026
A worker is on it now.
fix(ipv6-opts): rebuild HOPOPT and IPv6-Opts option areas byte-exactly (