diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-05 21:48:58 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-05 21:48:58 +0000 |
commit | 52f635294dc2220b27898d3db1703c9464b92fb1 (patch) | |
tree | 5c2d6cca90a4bcc953c4c704201e7c2d7c08188e /sys/netipx/ipx_input.c | |
parent | 84fa77ca902d7934ca42a7fdd806497b643a8421 (diff) |
Use more queue macros rather than doing it by hand; ok otto@ krw@
Diffstat (limited to 'sys/netipx/ipx_input.c')
-rw-r--r-- | sys/netipx/ipx_input.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index 658e8b62411..5c6d5c61371 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_input.c,v 1.20 2006/03/04 22:40:16 brad Exp $ */ +/* $OpenBSD: ipx_input.c,v 1.21 2006/03/05 21:48:57 miod Exp $ */ /*- * @@ -147,9 +147,7 @@ next: /* * Give any raw listeners a crack at the packet */ - for (ipxp = ipxrawcbtable.ipxpt_queue.cqh_first; - ipxp != (struct ipxpcb *)&ipxrawcbtable.ipxpt_queue; - ipxp = ipxp->ipxp_queue.cqe_next) { + CIRCLEQ_FOREACH(ipxp, &ipxrawcbtable.input_queue, ipxp_queue) { struct mbuf *m1 = m_copy(m, 0, (int)M_COPYALL); if (m1) ipx_input(m1, ipxp); @@ -205,8 +203,7 @@ next: * If it is a broadcast to the net where it was * received from, treat it as ours. */ - for (ia = ipx_ifaddr.tqh_first; ia; - ia = ia->ia_list.tqe_next) + TAILQ_FOREACH(ia, &ipx->if_addr, ia_list) if((ia->ia_ifa.ifa_ifp == m->m_pkthdr.rcvif) && ipx_neteq(ia->ia_addr.sipx_addr, ipx->ipx_dna)) @@ -231,7 +228,7 @@ next: * Is this our packet? If not, forward. */ } else { - for (ia = ipx_ifaddr.tqh_first; ia; ia = ia->ia_list.tqe_next) + TAILQ_FOREACH(ia, &ipx_ifaddr, ia_list) if (ipx_hosteq(ipx->ipx_dna, ia->ia_addr.sipx_addr) && (ipx_neteq(ipx->ipx_dna, ia->ia_addr.sipx_addr) || ipx_neteqnn(ipx->ipx_dna.ipx_net, ipx_zeronet))) @@ -460,9 +457,7 @@ struct ifnet *ifp; /* * Give any raw listeners a crack at the packet */ - for (ipxp = ipxrawcbtable.ipxpt_queue.cqh_first; - ipxp != (struct ipxpcb *)&ipxrawcbtable.ipxpt_queue; - ipxp = ipxp->ipxp_queue.cqe_next) { + CIRCLEQ_FOREACH(ipxp, &ipxrawcbtable.ipxpt_queue, ipxp_queue) { struct mbuf *m0 = m_copy(m, 0, (int)M_COPYALL); if (m0) { struct ipx *ipx; @@ -472,8 +467,7 @@ struct ifnet *ifp; continue; ipx = mtod(m0, struct ipx *); ipx->ipx_sna.ipx_net = ipx_zeronet; - for (ia = ipx_ifaddr.tqh_first; ia; - ia = ia->ia_list.tqe_next) + TAILQ_FOREACH(ia, &ipx_ifaddr, ia_list) if (ifp == ia->ia_ifp) break; if (ia == NULL) @@ -483,8 +477,7 @@ struct ifnet *ifp; ia->ia_addr.sipx_addr.ipx_host; if (ifp && (ifp->if_flags & IFF_POINTOPOINT)) - for(ifa = ifp->if_addrlist.tqh_first; ifa; - ifa = ifa->ifa_list.tqe_next) { + TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { if (ifa->ifa_addr->sa_family == AF_IPX) { ipx->ipx_sna = IA_SIPX(ifa)->sipx_addr; break; |