diff options
Diffstat (limited to 'sys/netatalk')
-rw-r--r-- | sys/netatalk/ddp_input.c | 2 | ||||
-rw-r--r-- | sys/netatalk/ddp_pcb.c | 10 | ||||
-rw-r--r-- | sys/netatalk/ddp_usrreq.c | 10 |
3 files changed, 20 insertions, 2 deletions
diff --git a/sys/netatalk/ddp_input.c b/sys/netatalk/ddp_input.c index 4ef497b..f9a06c8 100644 --- a/sys/netatalk/ddp_input.c +++ b/sys/netatalk/ddp_input.c @@ -410,7 +410,9 @@ ddp_input( m, ifp, elh, phase ) /* * And wake up whatever might be waiting for it */ + SOCK_LOCK(ddp->ddp_socket); sorwakeup( ddp->ddp_socket ); + SOCK_UNLOCK(ddp->ddp_socket); } #if 0 diff --git a/sys/netatalk/ddp_pcb.c b/sys/netatalk/ddp_pcb.c index fa79cec..63932cc 100644 --- a/sys/netatalk/ddp_pcb.c +++ b/sys/netatalk/ddp_pcb.c @@ -110,8 +110,11 @@ ddp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) s = splnet(); error = at_pcbconnect( ddp, nam, td ); splx(s); - if ( error == 0 ) + if ( error == 0 ) { + SOCK_LOCK( so ); soisconnected( so ); + SOCK_UNLOCK( so ); + } return(error); } @@ -134,7 +137,9 @@ ddp_disconnect(struct socket *so) at_pcbdisconnect( ddp ); ddp->ddp_fsat.sat_addr.s_node = ATADDR_ANYNODE; splx(s); + SOCK_LOCK( so ); soisdisconnected( so ); + SOCK_UNLOCK( so ); return(0); } @@ -204,7 +209,9 @@ ddp_abort(struct socket *so) if ( ddp == NULL ) { return(EINVAL); } + SOCK_LOCK( so ); soisdisconnected( so ); + SOCK_UNLOCK( so ); s = splnet(); at_pcbdetach( so, ddp ); splx(s); @@ -440,6 +447,7 @@ at_pcballoc( struct socket *so ) static void at_pcbdetach( struct socket *so, struct ddpcb *ddp) { + SOCK_LOCK( so ); soisdisconnected( so ); so->so_pcb = 0; sotryfree(so); diff --git a/sys/netatalk/ddp_usrreq.c b/sys/netatalk/ddp_usrreq.c index fa79cec..63932cc 100644 --- a/sys/netatalk/ddp_usrreq.c +++ b/sys/netatalk/ddp_usrreq.c @@ -110,8 +110,11 @@ ddp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) s = splnet(); error = at_pcbconnect( ddp, nam, td ); splx(s); - if ( error == 0 ) + if ( error == 0 ) { + SOCK_LOCK( so ); soisconnected( so ); + SOCK_UNLOCK( so ); + } return(error); } @@ -134,7 +137,9 @@ ddp_disconnect(struct socket *so) at_pcbdisconnect( ddp ); ddp->ddp_fsat.sat_addr.s_node = ATADDR_ANYNODE; splx(s); + SOCK_LOCK( so ); soisdisconnected( so ); + SOCK_UNLOCK( so ); return(0); } @@ -204,7 +209,9 @@ ddp_abort(struct socket *so) if ( ddp == NULL ) { return(EINVAL); } + SOCK_LOCK( so ); soisdisconnected( so ); + SOCK_UNLOCK( so ); s = splnet(); at_pcbdetach( so, ddp ); splx(s); @@ -440,6 +447,7 @@ at_pcballoc( struct socket *so ) static void at_pcbdetach( struct socket *so, struct ddpcb *ddp) { + SOCK_LOCK( so ); soisdisconnected( so ); so->so_pcb = 0; sotryfree(so); |