Module Name: src
Committed By: ozaki-r
Date: Wed Apr 15 08:47:28 UTC 2015
Modified Files:
src/sys/netinet: ip_encap.c
Log Message:
Use LIST_FOREACH_SAFE
We have to use LIST_FOREACH_SAFE because LIST_REMOVE is used
inside the loop through encap_remove.
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/netinet/ip_encap.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/netinet/ip_encap.c
diff -u src/sys/netinet/ip_encap.c:1.41 src/sys/netinet/ip_encap.c:1.42
--- src/sys/netinet/ip_encap.c:1.41 Wed Apr 15 03:38:50 2015
+++ src/sys/netinet/ip_encap.c Wed Apr 15 08:47:28 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_encap.c,v 1.41 2015/04/15 03:38:50 ozaki-r Exp $ */
+/* $NetBSD: ip_encap.c,v 1.42 2015/04/15 08:47:28 ozaki-r Exp $ */
/* $KAME: ip_encap.c,v 1.73 2001/10/02 08:30:58 itojun Exp $ */
/*
@@ -75,7 +75,7 @@
#define USE_RADIX
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.41 2015/04/15 03:38:50 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.42 2015/04/15 08:47:28 ozaki-r Exp $");
#include "opt_mrouting.h"
#include "opt_inet.h"
@@ -735,10 +735,10 @@ int
encap_detach(const struct encaptab *cookie)
{
const struct encaptab *ep = cookie;
- struct encaptab *p;
+ struct encaptab *p, *np;
int error;
- LIST_FOREACH(p, &encaptab, chain) {
+ LIST_FOREACH_SAFE(p, &encaptab, chain, np) {
if (p == ep) {
error = encap_remove(p);
if (error)