summaryrefslogtreecommitdiff
path: root/sys/netipx
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2005-01-09 05:10:43 +0000
committerRobert Watson <rwatson@FreeBSD.org>2005-01-09 05:10:43 +0000
commit0c3833b6ba94c861216566a6bb62b0f6cd2b602a (patch)
tree8f84fe0e883e64c196e832403fa50884cbb9be82 /sys/netipx
parent31f1a840d99b55ce3e7e98a663b8146eabf278a6 (diff)
Notes
Diffstat (limited to 'sys/netipx')
-rw-r--r--sys/netipx/ipx_pcb.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/netipx/ipx_pcb.c b/sys/netipx/ipx_pcb.c
index 322e569cb0d0..12f65778a2c1 100644
--- a/sys/netipx/ipx_pcb.c
+++ b/sys/netipx/ipx_pcb.c
@@ -63,6 +63,8 @@ ipx_pcballoc(so, head, td)
{
register struct ipxpcb *ipxp;
+ IPX_LIST_LOCK_ASSERT();
+
MALLOC(ipxp, struct ipxpcb *, sizeof *ipxp, M_PCB, M_NOWAIT | M_ZERO);
if (ipxp == NULL)
return (ENOBUFS);
@@ -84,6 +86,9 @@ ipx_pcbbind(ipxp, nam, td)
register struct sockaddr_ipx *sipx;
u_short lport = 0;
+ IPX_LIST_LOCK_ASSERT();
+ IPX_LOCK_ASSERT(ipxp);
+
if (ipxp->ipxp_lport || !ipx_nullhost(ipxp->ipxp_laddr))
return (EINVAL);
if (nam == NULL)
@@ -140,6 +145,9 @@ ipx_pcbconnect(ipxp, nam, td)
register struct route *ro;
struct ifnet *ifp;
+ IPX_LIST_LOCK_ASSERT();
+ IPX_LOCK_ASSERT(ipxp);
+
ia = NULL;
if (sipx->sipx_family != AF_IPX)
@@ -260,6 +268,9 @@ ipx_pcbdisconnect(ipxp)
struct ipxpcb *ipxp;
{
+ IPX_LIST_LOCK_ASSERT();
+ IPX_LOCK_ASSERT(ipxp);
+
ipxp->ipxp_faddr = zeroipx_addr;
if (ipxp->ipxp_socket->so_state & SS_NOFDREF)
ipx_pcbdetach(ipxp);
@@ -271,6 +282,9 @@ ipx_pcbdetach(ipxp)
{
struct socket *so = ipxp->ipxp_socket;
+ IPX_LIST_LOCK_ASSERT();
+ IPX_LOCK_ASSERT(ipxp);
+
ACCEPT_LOCK();
SOCK_LOCK(so);
so->so_pcb = NULL;
@@ -293,7 +307,9 @@ ipx_setsockaddr(ipxp, nam)
bzero((caddr_t)sipx, sizeof(*sipx));
sipx->sipx_len = sizeof(*sipx);
sipx->sipx_family = AF_IPX;
+ IPX_LOCK(ipxp);
sipx->sipx_addr = ipxp->ipxp_laddr;
+ IPX_UNLOCK(ipxp);
*nam = sodupsockaddr((struct sockaddr *)sipx, M_WAITOK);
}
@@ -303,12 +319,14 @@ ipx_setpeeraddr(ipxp, nam)
struct sockaddr **nam;
{
struct sockaddr_ipx *sipx, ssipx;
-
+
sipx = &ssipx;
bzero(sipx, sizeof(*sipx));
sipx->sipx_len = sizeof(*sipx);
sipx->sipx_family = AF_IPX;
+ IPX_LOCK(ipxp);
sipx->sipx_addr = ipxp->ipxp_faddr;
+ IPX_UNLOCK(ipxp);
*nam = sodupsockaddr((struct sockaddr *)sipx, M_WAITOK);
}
@@ -322,6 +340,8 @@ ipx_pcblookup(faddr, lport, wildp)
int matchwild = 3, wildcard;
u_short fport;
+ IPX_LIST_LOCK_ASSERT();
+
fport = faddr->x_port;
LIST_FOREACH(ipxp, &ipxpcb_list, ipxp_list) {
if (ipxp->ipxp_lport != lport)