diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-20 21:29:56 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-20 21:29:56 +0000 |
commit | 8c7c75cc622acf9af15b4ff664dd1e47d92a1119 (patch) | |
tree | 32eea1a80456caaadb567622d8e858dfe8f305b7 | |
parent | 45865285541caea17e34a97f58f91c98d990ceb2 (diff) | |
download | FreeBSD-src-8c7c75cc622acf9af15b4ff664dd1e47d92a1119.zip FreeBSD-src-8c7c75cc622acf9af15b4ff664dd1e47d92a1119.tar.gz |
Hold SOCK_LOCK(so) when frobbing so_state when disconnecting a
connected UNIX domain datagram socket.
-rw-r--r-- | sys/kern/uipc_usrreq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 16d80b4..6de52dd 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -906,6 +906,7 @@ unp_disconnect(unp) struct unpcb *unp; { register struct unpcb *unp2 = unp->unp_conn; + struct socket *so; UNP_LOCK_ASSERT(); @@ -916,7 +917,10 @@ unp_disconnect(unp) case SOCK_DGRAM: LIST_REMOVE(unp, unp_reflink); - unp->unp_socket->so_state &= ~SS_ISCONNECTED; + so = unp->unp_socket; + SOCK_LOCK(so); + so->so_state &= ~SS_ISCONNECTED; + SOCK_UNLOCK(so); break; case SOCK_STREAM: |