diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2013-03-22 01:41:13 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2013-03-22 01:41:13 +0000 |
commit | b2dbd43ff71ca4211b790a0791b34cbdbf744ff7 (patch) | |
tree | 379513ecfbfaee32e1d60590824f2930055a3bb1 /sys/netinet | |
parent | b3ef16b3b8c2cf2bb755f8983ee808b8f57e84d1 (diff) |
simple replacement of LIST_END with NULL. ok mpi
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 5 | ||||
-rw-r--r-- | sys/netinet/if_ether.h | 4 | ||||
-rw-r--r-- | sys/netinet/in.c | 7 | ||||
-rw-r--r-- | sys/netinet/in_var.h | 8 | ||||
-rw-r--r-- | sys/netinet/ip_carp.c | 5 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 15 |
6 files changed, 20 insertions, 24 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 0070d16fd6a..5290899c4e4 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.97 2013/03/07 09:03:16 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.98 2013/03/22 01:41:12 tedu Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -126,8 +126,7 @@ arptimer(void *arg) s = splsoftnet(); timeout_add_sec(to, arpt_prune); - for (la = LIST_FIRST(&llinfo_arp); la != LIST_END(&llinfo_arp); - la = nla) { + for (la = LIST_FIRST(&llinfo_arp); la != NULL; la = nla) { struct rtentry *rt = la->la_rt; nla = LIST_NEXT(la, la_list); diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 287fb8a4ef8..0b70ceb3f78 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.h,v 1.48 2012/10/18 00:36:22 deraadt Exp $ */ +/* $OpenBSD: if_ether.h,v 1.49 2013/03/22 01:41:12 tedu Exp $ */ /* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */ /* @@ -244,7 +244,7 @@ struct ether_multistep { /* struct ether_multi *enm; */ \ do { \ for ((enm) = LIST_FIRST(&(ac)->ac_multiaddrs); \ - (enm) != LIST_END(&(ac)->ac_multiaddrs) && \ + (enm) != NULL && \ (bcmp((enm)->enm_addrlo, (addrlo), ETHER_ADDR_LEN) != 0 || \ bcmp((enm)->enm_addrhi, (addrhi), ETHER_ADDR_LEN) != 0); \ (enm) = LIST_NEXT((enm), enm_list)); \ diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 1ae937681b4..f82fdcdb335 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.73 2013/03/07 09:03:16 mpi Exp $ */ +/* $OpenBSD: in.c,v 1.74 2013/03/22 01:41:12 tedu Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -224,8 +224,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) case SIOCAIFADDR: case SIOCDIFADDR: if (ifra->ifra_addr.sin_family == AF_INET) - for (; ia != TAILQ_END(&in_ifaddr); - ia = TAILQ_NEXT(ia, ia_list)) { + for (; ia != NULL; ia = TAILQ_NEXT(ia, ia_list)) { if (ia->ia_ifp == ifp && ia->ia_addr.sin_addr.s_addr == ifra->ifra_addr.sin_addr.s_addr) @@ -277,7 +276,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) if (ia && satosin(&ifr->ifr_addr)->sin_addr.s_addr) { struct in_ifaddr *ia2; - for (ia2 = ia; ia2 != TAILQ_END(&in_ifaddr); + for (ia2 = ia; ia2 != NULL; ia2 = TAILQ_NEXT(ia2, ia_list)) { if (ia2->ia_ifp == ifp && ia2->ia_addr.sin_addr.s_addr == diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index 110ed7944c2..a5e0031d836 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_var.h,v 1.18 2012/11/11 04:45:44 deraadt Exp $ */ +/* $OpenBSD: in_var.h,v 1.19 2013/03/22 01:41:12 tedu Exp $ */ /* $NetBSD: in_var.h,v 1.16 1996/02/13 23:42:15 christos Exp $ */ /* @@ -98,7 +98,7 @@ void in_socktrim(struct sockaddr_in *); do { \ struct in_ifaddr *ia; \ \ - for (ia = TAILQ_FIRST(&in_ifaddr); ia != TAILQ_END(&in_ifaddr) && \ + for (ia = TAILQ_FIRST(&in_ifaddr); ia != NULL && \ (ia->ia_ifp->if_rdomain != rtable_l2(rdomain) || \ ia->ia_addr.sin_addr.s_addr != (addr).s_addr); \ ia = TAILQ_NEXT(ia, ia_list)) \ @@ -115,7 +115,7 @@ do { \ /* struct in_ifaddr *ia; */ \ do { \ for ((ia) = TAILQ_FIRST(&in_ifaddr); \ - (ia) != TAILQ_END(&in_ifaddr) && (ia)->ia_ifp != (ifp); \ + (ia) != NULL && (ia)->ia_ifp != (ifp); \ (ia) = TAILQ_NEXT((ia), ia_list)) \ continue; \ } while (/* CONSTCOND */ 0) @@ -173,7 +173,7 @@ do { \ (inm) = NULL; \ else \ for ((inm) = LIST_FIRST(&ia->ia_multiaddrs); \ - (inm) != LIST_END(&ia->ia_multiaddrs) && \ + (inm) != NULL && \ (inm)->inm_addr.s_addr != (addr).s_addr; \ (inm) = LIST_NEXT(inm, inm_list)) \ continue; \ diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 81cb3eba4c2..1538238e398 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.198 2012/10/08 18:48:25 camield Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.199 2013/03/22 01:41:12 tedu Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -1028,8 +1028,7 @@ carp_destroy_vhosts(struct carp_softc *sc) /* XXX bow out? */ struct carp_vhost_entry *vhe, *nvhe; - for (vhe = LIST_FIRST(&sc->carp_vhosts); - vhe != LIST_END(&sc->carp_vhosts); vhe = nvhe) { + for (vhe = LIST_FIRST(&sc->carp_vhosts); vhe != NULL; vhe = nvhe) { nvhe = LIST_NEXT(vhe, vhost_entries); free(vhe, M_DEVBUF); } diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 3ac5f4b995d..f31d70a15cd 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.200 2012/11/06 12:32:42 henning Exp $ */ +/* $OpenBSD: ip_input.c,v 1.201 2013/03/22 01:41:12 tedu Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -814,8 +814,8 @@ ip_reass(struct ipqent *ipqe, struct ipq *fp) /* * Find a segment which begins after this one does. */ - for (p = NULL, q = LIST_FIRST(&fp->ipq_fragq); - q != LIST_END(&fp->ipq_fragq); p = q, q = LIST_NEXT(q, ipqe_q)) + for (p = NULL, q = LIST_FIRST(&fp->ipq_fragq); q != NULL; + p = q, q = LIST_NEXT(q, ipqe_q)) if (ntohs(q->ipqe_ip->ip_off) > ntohs(ipqe->ipqe_ip->ip_off)) break; @@ -873,8 +873,8 @@ insert: LIST_INSERT_AFTER(p, ipqe, ipqe_q); } next = 0; - for (p = NULL, q = LIST_FIRST(&fp->ipq_fragq); - q != LIST_END(&fp->ipq_fragq); p = q, q = LIST_NEXT(q, ipqe_q)) { + for (p = NULL, q = LIST_FIRST(&fp->ipq_fragq); q != NULL; + p = q, q = LIST_NEXT(q, ipqe_q)) { if (ntohs(q->ipqe_ip->ip_off) != next) return (0); next += ntohs(q->ipqe_ip->ip_len); @@ -947,8 +947,7 @@ ip_freef(struct ipq *fp) { struct ipqent *q, *p; - for (q = LIST_FIRST(&fp->ipq_fragq); q != LIST_END(&fp->ipq_fragq); - q = p) { + for (q = LIST_FIRST(&fp->ipq_fragq); q != NULL; q = p) { p = LIST_NEXT(q, ipqe_q); m_freem(q->ipqe_m); LIST_REMOVE(q, ipqe_q); @@ -970,7 +969,7 @@ ip_slowtimo(void) struct ipq *fp, *nfp; int s = splsoftnet(); - for (fp = LIST_FIRST(&ipq); fp != LIST_END(&ipq); fp = nfp) { + for (fp = LIST_FIRST(&ipq); fp != NULL; fp = nfp) { nfp = LIST_NEXT(fp, ipq_q); if (--fp->ipq_ttl == 0) { ipstat.ips_fragtimeout++; |