From 08d36b6c630846c4d9d812c25966639513ecd211 Mon Sep 17 00:00:00 2001 From: Toshi Kikuchi Date: Sat, 12 Dec 2020 15:29:15 -0800 Subject: Reduce the memory overhead in IP fragment management - Deep-copy pkt.Data and hold it instead of shallow-copy (vv.Clone). This allows the pkt's backing array, which includes the header portion, to be freed. - Remove fragHeap. The fragments are now held in holes struct instead. - Stop reserving the initial capacity of holes slice. PiperOrigin-RevId: 347198744 --- pkg/tcpip/network/fragmentation/fragmentation.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/tcpip/network/fragmentation/fragmentation.go') diff --git a/pkg/tcpip/network/fragmentation/fragmentation.go b/pkg/tcpip/network/fragmentation/fragmentation.go index d31296a41..1af87d713 100644 --- a/pkg/tcpip/network/fragmentation/fragmentation.go +++ b/pkg/tcpip/network/fragmentation/fragmentation.go @@ -53,6 +53,10 @@ var ( // ErrFragmentOverlap indicates that, during reassembly, a fragment overlaps // with another one. ErrFragmentOverlap = errors.New("overlapping fragments") + + // ErrFragmentConflict indicates that, during reassembly, some fragments are + // in conflict with one another. + ErrFragmentConflict = errors.New("conflicting fragments") ) // FragmentID is the identifier for a fragment. -- cgit v1.2.3