Module Name:    src
Committed By:   hannken
Date:           Wed Jul 13 09:56:20 UTC 2016

Modified Files:
        src/sys/net: route.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/net/route.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/route.c
diff -u src/sys/net/route.c:1.170 src/sys/net/route.c:1.171
--- src/sys/net/route.c:1.170	Mon Jul 11 07:37:00 2016
+++ src/sys/net/route.c	Wed Jul 13 09:56:20 2016
@@ -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 @@ static void
 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);
 	}

Reply via email to