selftests: net: gro: fix OOB access when under-coalescing

When more packets than expected are received, num_pkt
could index beyond the end of the array. Add a check to prevent
OOB access.

Continue receiving until the FIN is received to obtain
the total packet count. This helps diagnose issues by
distinguishing the cases where no coalescing happened from
the partial-coalescing cases that didn't meet the test check.

Signed-off-by: Narcisa Vasile <narcisav.kernel@gmail.com>
Link: https://patch.msgid.link/20260916010029.50911-1-narcisav.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Narcisa Vasile 2026-09-15 18:00:29 -07:00 • committed by Jakub Kicinski
commit 7bc21b7402