tcp: fix list iteration in tcp_lro_flush_active()

Use LIST_FOREACH_SAFE(), since the list element is removed from
the list in the loop body, zero out and inserted in the free list.

Reviewed by:		rrs
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46383
This commit is contained in:
Michael Tuexen
2024-08-21 00:07:37 +02:00
parent 417b35a97b
commit 64443828bb
+2 -2
View File
@@ -595,7 +595,7 @@ tcp_lro_rx_done(struct lro_ctrl *lc)
static void
tcp_lro_flush_active(struct lro_ctrl *lc)
{
struct lro_entry *le;
struct lro_entry *le, *le_tmp;
/*
* Walk through the list of le entries, and
@@ -607,7 +607,7 @@ tcp_lro_flush_active(struct lro_ctrl *lc)
* is being freed. This is ok it will just get
* reallocated again like it was new.
*/
LIST_FOREACH(le, &lc->lro_active, next) {
LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) {
if (le->m_head != NULL) {
tcp_lro_active_remove(le);
tcp_lro_flush(lc, le);