diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2004-06-12 20:47:32 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2004-06-12 20:47:32 +0000 |
commit | 395a08c90416e029c757cb51721b87b83fd0194b (patch) | |
tree | 2812a78c30b81fab868b44d389f32cc00ebadc47 /sys/netipx/ipx_pcb.c | |
parent | 2d0dc0fcd6b3153152856e0e6b4151faf8b79420 (diff) | |
download | src-395a08c90416e029c757cb51721b87b83fd0194b.tar.gz src-395a08c90416e029c757cb51721b87b83fd0194b.zip |
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
Notes
Notes:
svn path=/head/; revision=130387
Diffstat (limited to 'sys/netipx/ipx_pcb.c')
-rw-r--r-- | sys/netipx/ipx_pcb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netipx/ipx_pcb.c b/sys/netipx/ipx_pcb.c index f4f42f60ae10..2be7e1df92c4 100644 --- a/sys/netipx/ipx_pcb.c +++ b/sys/netipx/ipx_pcb.c @@ -268,6 +268,7 @@ ipx_pcbdetach(ipxp) { struct socket *so = ipxp->ipxp_socket; + SOCK_LOCK(so); so->so_pcb = 0; sotryfree(so); if (ipxp->ipxp_route.ro_rt != NULL) |