summaryrefslogtreecommitdiffstats
path: root/sys/netipx/ipx_input.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-01-09 05:06:19 +0000
committerrwatson <rwatson@FreeBSD.org>2005-01-09 05:06:19 +0000
commitcfbc0538b8d32d6ca38edda1273c41860d3af043 (patch)
treedbe7cd95415e7e3bfe5c7c7de95330ac580b4710 /sys/netipx/ipx_input.c
parenta6ab698ab0edb8e7baa3a6a732e387823f1c3dcd (diff)
downloadFreeBSD-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/ipx_input.c')
-rw-r--r--sys/netipx/ipx_input.c7
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();
}
OpenPOWER on IntegriCloud