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(reassembly): an IP datagram over 65,535 octets can read COMPLETE but short, or vanish in strict mode #1566
An IP datagram longer than 65,535 octets can be reported COMPLETE with its tail missing. In strict mode, a fragment clipped at the buffer edge can make the datagram disappear entirely. These were found in the #1564 review and re-measured on its head, e7c9e5fba. On main, the same inputs raise IndexError instead (#1565).
COMPLETE but short.
Input: fragments covering octets 0–65527, then a malformed 7-octet MF=1 fragment at offset 65528 (TL 27), then a final fragment at offset 64 with TL 65535.
The total data length (TDL) is 65,579, yet the datagram reads COMPLETE with 65,535 octets, in both strict and lax mode.
Cause: both completion checks test all(RCVBT[0:(TDL + 7) // 8]), and that slice silently stops at RCVBT's 8,192 entries (pcapkit/foundation/reassembly/ip.py:230-232 and :334-336 on e7c9e5fba).
Silent drop in strict mode.
Input: an 8-octet MF=1 fragment at offset 65528 (TL 28) is clipped to 7 octets by the buffer (:185).
The check held != length then sets no RCVBT bit (:215). Strict mode returns no datagram at all, and lax mode returns an empty PARTIAL one.
A 7-octet fragment at the same offset is reported. One extra octet changes the outcome.
Expected: a datagram that cannot fit is never COMPLETE, and a clipped fragment counts consistently. The reviewer's candidate fix is to require stop <= len(RCVBT) in both completion checks. In a scratch tree, that turns the first repro into PARTIAL while a legitimate 65,523-octet datagram still completes.
Blocked until #1564 merges, because the fix is in the same file.
Activity
JarryShaw commentedon Oct 10, 2026
Unblocked: #1564 has merged (
e0d3c8512). One worker is fixing this together with #1567, because both are inpcapkit/foundation/reassembly/ip.py.fix(reassembly): only the final fragment's partial block counts, and …