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:
@@ -595,7 +595,7 @@ tcp_lro_rx_done(struct lro_ctrl *lc)
|
|||||||
static void
|
static void
|
||||||
tcp_lro_flush_active(struct lro_ctrl *lc)
|
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
|
* 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
|
* is being freed. This is ok it will just get
|
||||||
* reallocated again like it was new.
|
* 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) {
|
if (le->m_head != NULL) {
|
||||||
tcp_lro_active_remove(le);
|
tcp_lro_active_remove(le);
|
||||||
tcp_lro_flush(lc, le);
|
tcp_lro_flush(lc, le);
|
||||||
|
|||||||
Reference in New Issue
Block a user