Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net rtcache_clear_rtentry: use LIST_FOREACH_SAFE as the ...



details:   https://anonhg.NetBSD.org/src/rev/68e715daaab1
branches:  trunk
changeset: 346443:68e715daaab1
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jul 13 09:56:20 2016 +0000

description:
rtcache_clear_rtentry: use LIST_FOREACH_SAFE as the element gets
removed from the list.

diffstat:

 sys/net/route.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 90a6ddf6c0d8 -r 68e715daaab1 sys/net/route.c
--- a/sys/net/route.c   Wed Jul 13 09:53:16 2016 +0000
+++ b/sys/net/route.c   Wed Jul 13 09:56:20 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.170 2016/07/11 07:37:00 ozaki-r Exp $      */
+/*     $NetBSD: route.c,v 1.171 2016/07/13 09:56:20 hannken Exp $      */
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.170 2016/07/11 07:37:00 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.171 2016/07/13 09:56:20 hannken Exp $");
 
 #include <sys/param.h>
 #ifdef RTFLUSH_DEBUG
@@ -1410,12 +1410,12 @@
 rtcache_clear_rtentry(int family, struct rtentry *rt)
 {
        struct domain *dom;
-       struct route *ro;
+       struct route *ro, *nro;
 
        if ((dom = pffinddomain(family)) == NULL)
                return;
 
-       LIST_FOREACH(ro, &dom->dom_rtcache, ro_rtcache_next) {
+       LIST_FOREACH_SAFE(ro, &dom->dom_rtcache, ro_rtcache_next, nro) {
                if (ro->_ro_rt == rt)
                        rtcache_clear(ro);
        }



Home | Main Index | Thread Index | Old Index