Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/source/pcapkit/foundation/reassembly/ip/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@ Algorithm
flush all reassembly with this BUFID;
DONE.
}

Because completion frees the buffer (:rfc:`791#section-3.2`), a fragment that
arrives after its datagram has completed opens a new buffer, which is later
reported as a separate incomplete datagram; this is intended (:issue:`1507`).
10 changes: 10 additions & 0 deletions pcapkit/foundation/reassembly/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ def reassembly(self, info: 'Packet[_AT]') -> 'None':
Arguments:
info: info dict of packets to be reassembled

Note:
A completed datagram's buffer is freed, as in the
:rfc:`791#section-3.2` reassembly procedure, so a fragment of it
that arrives afterwards -- a late duplicate, say -- opens a new
buffer. The caller sees that buffer as a separate incomplete
datagram, ``PARTIAL`` at the end of the capture or ``TIMEOUT`` if
it expires first. This is intended, is permitted by
:rfc:`8200#section-4.5`, and matches Linux, Zeek and Wireshark
(:issue:`1507`).

"""
# clear cache
self._flag_n = False
Expand Down
Loading