diff options
Diffstat (limited to 'sys/netatalk/ddp_usrreq.c')
-rw-r--r-- | sys/netatalk/ddp_usrreq.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |