diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-12-30 17:49:40 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-12-30 17:49:40 +0000 |
commit | 767b9c0b3efe618078d08c4cf137ab912f502ca2 (patch) | |
tree | a750ac94e75e406a21cd733a1d3edf909cf38c11 /sys/netipx/ipx_input.c | |
parent | 547414a25a19e2404c14c52038ec7fe4fa7b4b05 (diff) | |
download | FreeBSD-src-767b9c0b3efe618078d08c4cf137ab912f502ca2.zip FreeBSD-src-767b9c0b3efe618078d08c4cf137ab912f502ca2.tar.gz |
Convert netipx to use queue(9) doubly-linked lists instead of home-brew
linked lists for ipxpcb's.
Diffstat (limited to 'sys/netipx/ipx_input.c')
-rw-r--r-- | sys/netipx/ipx_input.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index 9e12ac6..e7036e2 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -1,4 +1,5 @@ /* + * Copyright (c) 2004, Robert N. M. Watson * Copyright (c) 1995, Mike Mitchell * Copyright (c) 1984, 1985, 1986, 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -84,8 +85,11 @@ const union ipx_host ipx_broadhost = { .s_host[0] = 0xffff, struct ipxstat ipxstat; struct sockaddr_ipx ipx_netmask, ipx_hostmask; -struct ipxpcb ipxpcb; -struct ipxpcb ipxrawpcb; +/* + * IPX protocol control block (pcb) lists. + */ +struct ipxpcbhead ipxpcb_list; +struct ipxpcbhead ipxrawpcb_list; static int ipxqmaxlen = IFQ_MAXLEN; static struct ifqueue ipxintrq; @@ -106,8 +110,9 @@ ipx_init() { read_random(&ipx_pexseq, sizeof ipx_pexseq); - ipxpcb.ipxp_next = ipxpcb.ipxp_prev = &ipxpcb; - ipxrawpcb.ipxp_next = ipxrawpcb.ipxp_prev = &ipxrawpcb; + + LIST_INIT(&ipxpcb_list); + LIST_INIT(&ipxrawpcb_list); ipx_netmask.sipx_len = 6; ipx_netmask.sipx_addr.x_net = ipx_broadnet; @@ -152,8 +157,7 @@ ipxintr(struct mbuf *m) /* * Give any raw listeners a crack at the packet */ - for (ipxp = ipxrawpcb.ipxp_next; ipxp != &ipxrawpcb; - ipxp = ipxp->ipxp_next) { + LIST_FOREACH(ipxp, &ipxrawpcb_list, ipxp_list) { struct mbuf *m1 = m_copy(m, 0, (int)M_COPYALL); if (m1 != NULL) ipx_input(m1, ipxp); @@ -466,8 +470,7 @@ struct ifnet *ifp; /* * Give any raw listeners a crack at the packet */ - for (ipxp = ipxrawpcb.ipxp_next; ipxp != &ipxrawpcb; - ipxp = ipxp->ipxp_next) { + LIST_FOREACH(ipxp, &ipxrawpcb_list, ipxp_list) { struct mbuf *m0 = m_copy(m, 0, (int)M_COPYALL); if (m0 != NULL) { register struct ipx *ipx; |