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(dpkt): extract(engine='dpkt') lets a raw AttributeError escape on an IPv6 Fragment header followed by ESP or Destination Options #1351
Describe the bug
dpkt 1.9.8 dpkt/ip6.py:96 evaluates ext.frag_off for any header whose predecessor has nxt == 44, so an IPv6 Fragment header followed by ESP (50) or Destination Options (60) raises AttributeError: 'IP6ESPHeader' object has no attribute 'frag_off'. That is upstream, but pcapkit/foundation/engines/dpkt.py:163 (packet = protocol(pkt)) does not catch it, so the raw error aborts the whole extraction instead of an in-library error.
To Reproduce
One Ethernet frame, IPv6 nxt=44, Fragment header 32 00 00 00 00 00 00 01 (next header ESP, offset 0, M=0) + 8 octets, in a pcap: pcapkit.extract(fin='x.pcap', engine='dpkt', nofile=True, store=False) -> AttributeError: 'IP6ESPHeader' object has no attribute 'frag_off'. Next header 60 (payload 3b00010400000000) raises 'IP6DstOptsHeader' ... 'frag_off'.
Expected behavior
The engine converts a dpkt parse failure into a pcapkit error (or skips the frame with a warning) rather than leaking the third-party exception.
Found by the PR cross-review follow-up round-trip audit (#1202). The repro was re-checked by an independent verifier, and I re-ran it on main at c9676c563.
Blocked until#1335 merges, because both edit pcapkit/foundation/engines/dpkt.py. The uncaught call is engines/dpkt.py:163 (packet = protocol(pkt)); the raise itself is upstream in dpkt 1.9.8 dpkt/ip6.py:96.
Activity
JarryShaw commentedon Oct 7, 2026
Blocked until #1335 merges, because both edit
pcapkit/foundation/engines/dpkt.py. The uncaught call isengines/dpkt.py:163(packet = protocol(pkt)); the raise itself is upstream in dpkt 1.9.8dpkt/ip6.py:96.JarryShaw commentedon Oct 7, 2026
Unblocked: #1335 merged at 20:41Z. Back to
pending.fix(dpkt): extract(engine='dpkt') keeps a frame dpkt cannot parse ins…