HomeFreeBSD

frag6: fix counter leak in error case and optimise code

Description

frag6: fix counter leak in error case and optimise code

In case the first fragmented part (off=0) arrives we check for the
maximum packet size for each fragmented part we already queued with the
addition of the unfragmentable part from the first one.

For one we do not have to enter the loop at all if this is the first
fragmented part to arrive, and we can skip the check.

Should we encounter an error case we send an ICMPv6 message for any
fragment exceeding the maximum length limit. While dequeueing the
original packet and freeing it, statistics were not updated and leaked
both the reassembly queue count for the fragment and the global
fragment count. Found by code inspection and confirmed by tightening
test cases checking more statistical and system counters.

While here properly wrap a line.

MFC after: 3 weeks
Sponsored by: Netflix

Details

Committed
bzOct 24 2019, 7:57 PM
Parents
rS354039: Allow loader.efi to identify non-standard boot setup
Branches
Unknown
Tags
Unknown