Date: Thu, 9 Apr 2015 09:00:33 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281296 - head/sys/netinet Message-ID: <201504090900.t3990XFf079795@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Thu Apr 9 09:00:32 2015 New Revision: 281296 URL: https://svnweb.freebsd.org/changeset/base/281296 Log: Use TAILQ_FOREACH_SAFE() instead of implementing it ourselves. Sponsored by: Nginx, Inc. Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Apr 9 08:56:23 2015 (r281295) +++ head/sys/netinet/ip_input.c Thu Apr 9 09:00:32 2015 (r281296) @@ -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); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504090900.t3990XFf079795>