diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-12 20:47:32 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-12 20:47:32 +0000 |
commit | 82295697cd4bae93852c3a10a939f20227018fbd (patch) | |
tree | 2812a78c30b81fab868b44d389f32cc00ebadc47 /sys/netipx/ipx_usrreq.c | |
parent | f6af690bdeb2e55a1bdabd5af91a8a601955e892 (diff) | |
download | FreeBSD-src-82295697cd4bae93852c3a10a939f20227018fbd.zip FreeBSD-src-82295697cd4bae93852c3a10a939f20227018fbd.tar.gz |
Extend coverage of SOCK_LOCK(so) to include so_count, the socket
reference count:
- Assert SOCK_LOCK(so) macros that directly manipulate so_count:
soref(), sorele().
- Assert SOCK_LOCK(so) in macros/functions that rely on the state of
so_count: sofree(), sotryfree().
- Acquire SOCK_LOCK(so) before calling these functions or macros in
various contexts in the stack, both at the socket and protocol
layers.
- In some cases, perform soisdisconnected() before sotryfree(), as
this could result in frobbing of a non-present socket if
sotryfree() actually frees the socket.
- Note that sofree()/sotryfree() will release the socket lock even if
they don't free the socket.
Submitted by: sam
Sponsored by: FreeBSD Foundation
Obtained from: BSD/OS
Diffstat (limited to 'sys/netipx/ipx_usrreq.c')
-rw-r--r-- | sys/netipx/ipx_usrreq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index 383d2af..f07cecb 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -423,8 +423,9 @@ ipx_usr_abort(so) s = splnet(); ipx_pcbdetach(ipxp); splx(s); - sotryfree(so); soisdisconnected(so); + SOCK_LOCK(so); + sotryfree(so); return (0); } |