diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-01-09 05:06:19 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-01-09 05:06:19 +0000 |
commit | cfbc0538b8d32d6ca38edda1273c41860d3af043 (patch) | |
tree | dbe7cd95415e7e3bfe5c7c7de95330ac580b4710 /sys/netipx | |
parent | a6ab698ab0edb8e7baa3a6a732e387823f1c3dcd (diff) | |
download | FreeBSD-src-cfbc0538b8d32d6ca38edda1273c41860d3af043.zip FreeBSD-src-cfbc0538b8d32d6ca38edda1273c41860d3af043.tar.gz |
Hold the global IPX PCB list mutex in the IPX input path when walking
the IPX PCB list.
MFC after: 3 weeks
Diffstat (limited to 'sys/netipx')
-rw-r--r-- | sys/netipx/ipx_input.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index 0e8f75e..92d4e38 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -162,11 +162,13 @@ ipxintr(struct mbuf *m) /* * Give any raw listeners a crack at the packet */ + IPX_LIST_LOCK(); LIST_FOREACH(ipxp, &ipxrawpcb_list, ipxp_list) { struct mbuf *m1 = m_copy(m, 0, (int)M_COPYALL); if (m1 != NULL) ipx_input(m1, ipxp); } + IPX_LIST_UNLOCK(); ipx = mtod(m, struct ipx *); len = ntohs(ipx->ipx_len); @@ -262,6 +264,7 @@ ours: /* * Locate pcb for datagram. */ + IPX_LIST_LOCK(); ipxp = ipx_pcblookup(&ipx->ipx_sna, ipx->ipx_dna.x_port, IPX_WILDCARD); /* * Switch out to protocol's input routine. @@ -272,11 +275,13 @@ ours: switch (ipx->ipx_pt) { case IPXPROTO_SPX: spx_input(m, ipxp); + IPX_LIST_UNLOCK(); return; } ipx_input(m, ipxp); } else m_freem(m); + IPX_LIST_UNLOCK(); } void @@ -474,6 +479,7 @@ struct ifnet *ifp; /* * Give any raw listeners a crack at the packet */ + IPX_LIST_LOCK(); LIST_FOREACH(ipxp, &ipxrawpcb_list, ipxp_list) { struct mbuf *m0 = m_copy(m, 0, (int)M_COPYALL); if (m0 != NULL) { @@ -504,4 +510,5 @@ struct ifnet *ifp; ipx_input(m0, ipxp); } } + IPX_LIST_UNLOCK(); } |