diff options
author | jhb <jhb@FreeBSD.org> | 2013-09-05 14:26:37 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-09-05 14:26:37 +0000 |
commit | 42eb0e69b4a01ca059fa4db4d572fa4154de4bb7 (patch) | |
tree | b544ab69d0c5e00fb392dfa0361c5bdd9d82fbd6 /sys/netinet/ip_mroute.c | |
parent | 057d03f1deec896feae9a7bfe79a5f8905997f06 (diff) | |
download | FreeBSD-src-42eb0e69b4a01ca059fa4db4d572fa4154de4bb7.zip FreeBSD-src-42eb0e69b4a01ca059fa4db4d572fa4154de4bb7.tar.gz |
Use LIST_FOREACH_SAFE() instead of doing it by hand.
Diffstat (limited to 'sys/netinet/ip_mroute.c')
-rw-r--r-- | sys/netinet/ip_mroute.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index d490bbe..3a03def 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -634,8 +634,8 @@ if_detached_event(void *arg __unused, struct ifnet *ifp) continue; for (i = 0; i < mfchashsize; i++) { struct mfc *rt, *nrt; - for (rt = LIST_FIRST(&V_mfchashtbl[i]); rt; rt = nrt) { - nrt = LIST_NEXT(rt, mfc_hash); + + LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { if (rt->mfc_parent == vifi) { expire_mfc(rt); } @@ -753,8 +753,8 @@ X_ip_mrouter_done(void) */ for (i = 0; i < mfchashsize; i++) { struct mfc *rt, *nrt; - for (rt = LIST_FIRST(&V_mfchashtbl[i]); rt; rt = nrt) { - nrt = LIST_NEXT(rt, mfc_hash); + + LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { expire_mfc(rt); } } @@ -1445,9 +1445,7 @@ expire_upcalls(void *arg) if (V_nexpire[i] == 0) continue; - for (rt = LIST_FIRST(&V_mfchashtbl[i]); rt; rt = nrt) { - nrt = LIST_NEXT(rt, mfc_hash); - + LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { if (TAILQ_EMPTY(&rt->mfc_stall)) continue; |