Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Use LIST_FOREACH_SAFE in bridge_rt* functions
details: https://anonhg.NetBSD.org/src/rev/cf71ac8c14d2
branches: trunk
changeset: 335093:cf71ac8c14d2
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Dec 25 09:10:01 2014 +0000
description:
Use LIST_FOREACH_SAFE in bridge_rt* functions
diffstat:
sys/net/if_bridge.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diffs (58 lines):
diff -r 8e177c4f9ffe -r cf71ac8c14d2 sys/net/if_bridge.c
--- a/sys/net/if_bridge.c Thu Dec 25 08:11:09 2014 +0000
+++ b/sys/net/if_bridge.c Thu Dec 25 09:10:01 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bridge.c,v 1.93 2014/12/24 08:55:09 ozaki-r Exp $ */
+/* $NetBSD: if_bridge.c,v 1.94 2014/12/25 09:10:01 ozaki-r Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.93 2014/12/24 08:55:09 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.94 2014/12/25 09:10:01 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_bridge_ipf.h"
@@ -2043,8 +2043,7 @@
if (sc->sc_brtcnt <= sc->sc_brtmax)
goto out;
- for (brt = LIST_FIRST(&sc->sc_rtlist); brt != NULL; brt = nbrt) {
- nbrt = LIST_NEXT(brt, brt_list);
+ LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) {
if ((brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) {
bridge_rtnode_destroy(sc, brt);
if (sc->sc_brtcnt <= sc->sc_brtmax)
@@ -2091,8 +2090,7 @@
KASSERT(mutex_owned(sc->sc_rtlist_lock));
- for (brt = LIST_FIRST(&sc->sc_rtlist); brt != NULL; brt = nbrt) {
- nbrt = LIST_NEXT(brt, brt_list);
+ LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) {
if ((brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) {
if (time_uptime >= brt->brt_expire)
bridge_rtnode_destroy(sc, brt);
@@ -2112,8 +2110,7 @@
mutex_enter(sc->sc_rtlist_lock);
- for (brt = LIST_FIRST(&sc->sc_rtlist); brt != NULL; brt = nbrt) {
- nbrt = LIST_NEXT(brt, brt_list);
+ LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) {
if (full || (brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC)
bridge_rtnode_destroy(sc, brt);
}
@@ -2159,8 +2156,7 @@
mutex_enter(sc->sc_rtlist_lock);
- for (brt = LIST_FIRST(&sc->sc_rtlist); brt != NULL; brt = nbrt) {
- nbrt = LIST_NEXT(brt, brt_list);
+ LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) {
if (brt->brt_ifp == ifp)
bridge_rtnode_destroy(sc, brt);
}
Home |
Main Index |
Thread Index |
Old Index