diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2015-04-09 09:00:32 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2015-04-09 09:00:32 +0000 |
commit | 71c70e138d3e3d8dd95d0e1b67158bde711cff10 (patch) | |
tree | 6b369e2765f6bf76cd838839f49eb5f58352a247 /sys/netinet/ip_input.c | |
parent | 1c0b48c79a6fd444009ea0772a2f2e5f0c8a667e (diff) | |
download | src-test2-71c70e138d3e3d8dd95d0e1b67158bde711cff10.tar.gz src-test2-71c70e138d3e3d8dd95d0e1b67158bde711cff10.zip |
Notes
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 71db168f0e6e..95433818f27e 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1294,7 +1294,7 @@ void ip_slowtimo(void) { VNET_ITERATOR_DECL(vnet_iter); - struct ipq *fp; + struct ipq *fp, *tmp; int i; VNET_LIST_RLOCK_NOSLEEP(); @@ -1302,14 +1302,9 @@ ip_slowtimo(void) CURVNET_SET(vnet_iter); for (i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); - for(fp = TAILQ_FIRST(&V_ipq[i]); fp;) { - struct ipq *fpp; - - fpp = fp; - fp = TAILQ_NEXT(fp, ipq_list); - if(--fpp->ipq_ttl == 0) - ipq_timeout(&V_ipq[i], fpp); - } + TAILQ_FOREACH_SAFE(fp, &V_ipq[i], ipq_list, tmp) + if (--fp->ipq_ttl == 0) + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } /* |