Use LIST_FOREACH().
This commit is contained in:
parent
d4240170d8
commit
8cfa750e0f
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ip_gre.c,v 1.43 2006/11/16 22:26:36 dyoung Exp $ */
|
||||
/* $NetBSD: ip_gre.c,v 1.44 2006/11/16 22:54:14 dyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -45,7 +45,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ip_gre.c,v 1.43 2006/11/16 22:26:36 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ip_gre.c,v 1.44 2006/11/16 22:54:14 dyoung Exp $");
|
||||
|
||||
#include "gre.h"
|
||||
#if NGRE > 0
|
||||
@ -254,8 +254,7 @@ gre_lookup(struct mbuf *m, u_int8_t proto)
|
||||
const struct ip *ip = mtod(m, const struct ip *);
|
||||
struct gre_softc *sc;
|
||||
|
||||
for (sc = LIST_FIRST(&gre_softc_list); sc != NULL;
|
||||
sc = LIST_NEXT(sc, sc_list)) {
|
||||
LIST_FOREACH(sc, &gre_softc_list, sc_list) {
|
||||
if (sc->g_dst.s_addr == ip->ip_src.s_addr &&
|
||||
sc->g_src.s_addr == ip->ip_dst.s_addr &&
|
||||
sc->sc_proto == proto &&
|
||||
|
Loading…
Reference in New Issue
Block a user