Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Use LIST_FOREACH_SAFE



details:   https://anonhg.NetBSD.org/src/rev/c60d91f16b86
branches:  trunk
changeset: 807602:c60d91f16b86
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Wed Apr 15 08:47:28 2015 +0000

description:
Use LIST_FOREACH_SAFE

We have to use LIST_FOREACH_SAFE because LIST_REMOVE is used
inside the loop through encap_remove.

diffstat:

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

diffs (31 lines):

diff -r 4042395174cd -r c60d91f16b86 sys/netinet/ip_encap.c
--- a/sys/netinet/ip_encap.c    Wed Apr 15 08:31:05 2015 +0000
+++ b/sys/netinet/ip_encap.c    Wed Apr 15 08:47:28 2015 +0000
@@ -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 @@
 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)



Home | Main Index | Thread Index | Old Index