From 02e5dff4f0a5d8f1d064fd1762ac674c650a0d0d Mon Sep 17 00:00:00 2001 From: tuexen Date: Sun, 5 Jan 2020 13:56:32 +0000 Subject: [PATCH] Ensure that we don't miss a trigger for kicking off the SCTP iterator. Reported by: nwhitehorn@ MFC after: 1 week --- sys/netinet/sctputil.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index cc4f34224ed4..cbda6e2c4948 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1475,12 +1475,11 @@ no_stcb: void sctp_iterator_worker(void) { - struct sctp_iterator *it, *nit; + struct sctp_iterator *it; /* This function is called with the WQ lock in place */ - sctp_it_ctl.iterator_running = 1; - TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { + while ((it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead)) != NULL) { /* now lets work on this one */ TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); SCTP_IPI_ITERATOR_WQ_UNLOCK();