summaryrefslogtreecommitdiff
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2013-03-15 20:45:35 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2013-03-15 20:45:35 +0000
commitfda623dd425db251eda7b492bf06d2a849b58c55 (patch)
treeef00540411ec1e2adcae39b2c74af3011ba55907 /sys/net/if_bridge.c
parent5546879c684ac5b171cdef00e32e87c179f28738 (diff)
change LIST_END to literal NULL for clarity.
ok claudio mpi
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index b5f2fdc52d6..decc0ed545b 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.205 2013/01/23 13:28:36 camield Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.206 2013/03/15 20:45:34 tedu Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -322,7 +322,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
TAILQ_FOREACH(p, &sc->sc_spanlist, next)
if (p->ifp == ifs)
break;
- if (p != TAILQ_END(&sc->sc_spanlist)) {
+ if (p != NULL) {
error = EBUSY;
break;
}
@@ -424,7 +424,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (p->ifp == ifs)
break;
}
- if (p != TAILQ_END(&sc->sc_spanlist)) {
+ if (p != NULL) {
error = EEXIST;
break;
}
@@ -450,7 +450,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
}
}
- if (p == TAILQ_END(&sc->sc_spanlist)) {
+ if (p == NULL) {
error = ENOENT;
break;
}
@@ -1053,7 +1053,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
sc->sc_if.if_oerrors++;
continue;
}
- if (TAILQ_NEXT(p, next) == TAILQ_END(&sc->sc_iflist)) {
+ if (TAILQ_NEXT(p, next) == NULL) {
used = 1;
mc = m;
} else {
@@ -1397,7 +1397,7 @@ bridge_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
if (ifl->ifp->if_type == IFT_ETHER)
break;
}
- if (ifl != TAILQ_END(&sc->sc_iflist)) {
+ if (ifl != NULL) {
m->m_pkthdr.rcvif = ifl->ifp;
m->m_pkthdr.rdomain = ifl->ifp->if_rdomain;
#if NBPFILTER > 0
@@ -1552,7 +1552,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *ifp,
bridge_localbroadcast(sc, dst_if, eh, m);
/* If last one, reuse the passed-in mbuf */
- if (TAILQ_NEXT(p, next) == TAILQ_END(&sc->sc_iflist)) {
+ if (TAILQ_NEXT(p, next) == NULL) {
mc = m;
used = 1;
} else {
@@ -1708,7 +1708,7 @@ bridge_rtupdate(struct bridge_softc *sc, struct ether_addr *ea,
h = bridge_hash(sc, ea);
p = LIST_FIRST(&sc->sc_rts[h]);
- if (p == LIST_END(&sc->sc_rts[h])) {
+ if (p == NULL) {
if (sc->sc_brtcnt >= sc->sc_brtmax)
goto done;
p = malloc(sizeof(*p), M_DEVBUF, M_NOWAIT);
@@ -1768,7 +1768,7 @@ bridge_rtupdate(struct bridge_softc *sc, struct ether_addr *ea,
goto want;
}
- if (p == LIST_END(&sc->sc_rts[h])) {
+ if (p == NULL) {
if (sc->sc_brtcnt >= sc->sc_brtmax)
goto done;
p = malloc(sizeof(*p), M_DEVBUF, M_NOWAIT);
@@ -1787,7 +1787,7 @@ bridge_rtupdate(struct bridge_softc *sc, struct ether_addr *ea,
sc->sc_brtcnt++;
goto want;
}
- } while (p != LIST_END(&sc->sc_rts[h]));
+ } while (p != NULL);
done:
ifp = NULL;
@@ -1871,7 +1871,7 @@ bridge_rtage(struct bridge_softc *sc)
for (i = 0; i < BRIDGE_RTABLE_SIZE; i++) {
n = LIST_FIRST(&sc->sc_rts[i]);
- while (n != LIST_END(&sc->sc_rts[i])) {
+ while (n != NULL) {
if ((n->brt_flags & IFBAF_TYPEMASK) == IFBAF_STATIC) {
n->brt_age = !n->brt_age;
if (n->brt_age)
@@ -1937,7 +1937,7 @@ bridge_rtflush(struct bridge_softc *sc, int full)
for (i = 0; i < BRIDGE_RTABLE_SIZE; i++) {
n = LIST_FIRST(&sc->sc_rts[i]);
- while (n != LIST_END(&sc->sc_rts[i])) {
+ while (n != NULL) {
if (full ||
(n->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) {
p = LIST_NEXT(n, brt_next);
@@ -1987,7 +1987,7 @@ bridge_rtdelete(struct bridge_softc *sc, struct ifnet *ifp, int dynonly)
*/
for (i = 0; i < BRIDGE_RTABLE_SIZE; i++) {
n = LIST_FIRST(&sc->sc_rts[i]);
- while (n != LIST_END(&sc->sc_rts[i])) {
+ while (n != NULL) {
if (n->brt_if != ifp) {
/* Not ours */
n = LIST_NEXT(n, brt_next);