diff options
Diffstat (limited to 'sys/netnatm/natm.c')
-rw-r--r-- | sys/netnatm/natm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c index e0535b6..27a9bd4 100644 --- a/sys/netnatm/natm.c +++ b/sys/netnatm/natm.c @@ -134,6 +134,7 @@ natm_usr_detach(struct socket *so) */ npcb_free(npcb, NPCB_DESTROY); /* drain */ so->so_pcb = NULL; + SOCK_LOCK(so); sotryfree(so); out: splx(s); @@ -216,7 +217,9 @@ natm_usr_connect(struct socket *so, struct sockaddr *nam, d_thread_t *p) } splx(s2); + SOCK_LOCK(so); soisconnected(so); + SOCK_UNLOCK(so); out: splx(s); @@ -259,7 +262,9 @@ natm_usr_disconnect(struct socket *so) splx(s2); npcb_free(npcb, NPCB_REMOVE); + SOCK_LOCK(so); soisdisconnected(so); + SOCK_UNLOCK(so); out: splx(s); @@ -482,6 +487,7 @@ struct proc *p; npcb_free(npcb, NPCB_DESTROY); /* drain */ so->so_pcb = NULL; + SOCK_LOCK(so); sotryfree(so); break; @@ -552,7 +558,9 @@ struct proc *p; } splx(s2); + SOCK_LOCK(so); soisconnected(so); + SOCK_UNLOCK(so); break; @@ -579,7 +587,9 @@ struct proc *p; splx(s2); npcb_free(npcb, NPCB_REMOVE); + SOCK_LOCK(so); soisdisconnected(so); + SOCK_UNLOCK(so); break; @@ -752,7 +762,9 @@ m->m_pkthdr.rcvif = NULL; /* null it out to be safe */ natm_sookbytes += m->m_pkthdr.len; #endif sbappendrecord(&so->so_rcv, m); + SOCK_LOCK(so); sorwakeup(so); + SOCK_UNLOCK(so); } else { #ifdef NATM_STAT natm_sodropcnt++; |