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(schema): SMF_DPD option at the end of the header raises TypeError from smf_i_dpd_id_len #1195
Describe the bug
When an SMF_DPD option sits in the last two bytes of a HOPOPT or IPv6-Opts header, parsing it raises a bare TypeError instead of an in-library error. The ConditionalField skips len, so pkt['len'] is the NO_VALUE sentinel, and smf_i_dpd_id_len subtracts from it without a guard. This happens at pcapkit/protocols/schema/internet/hopopt.py:159, and schema/internet/ipv6_opts.py:159 has the same line.
To Reproduce
On origin/main (a2f989fbd), run HOPOPT(io.BytesIO(bytes.fromhex('3b00010200000800'))). It raises TypeError: unsupported operand type(s) for -: 'NoValueType' and 'int'. IPv6_Opts behaves the same way.
Expected behavior
A truncated option raises an in-library error, as its siblings already do. CALIPSO (…0700) raises FieldValueError: invalid CALIPSO option length: 0, and MPL (…6d00) raises the equivalent MPL error.
The #1193 worker found this, and the #1194 cross-review reproduced it. That review swept all 256 option types at that position, and only type 8 raises TypeError. I re-ran it on main.
Activity
JarryShaw commentedon Oct 7, 2026
A worker is on it now.
docs(changelog): record the post-#719 defect wave (#1168-#1197)