diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-01-09 05:31:16 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-01-09 05:31:16 +0000 |
commit | 29ba9d8b8d3d04e71d1ccf39cdd6f0d20b865f9b (patch) | |
tree | 6d2fa3ecab37e2b4b96021927bc6d5c421ba73af /sys/netipx/ipx_input.c | |
parent | 751d9ba04aa28f1df6f2752eac81aee6ff47dc5b (diff) | |
download | FreeBSD-src-29ba9d8b8d3d04e71d1ccf39cdd6f0d20b865f9b.zip FreeBSD-src-29ba9d8b8d3d04e71d1ccf39cdd6f0d20b865f9b.tar.gz |
Use the IPX PCB list mutex and IPX PCB mutexes to lock down the SPX
portion of IPX/SPX:
- Protect IPX PCB lists with the IPX PCB list mutex, in particular
when calling PCB and PCB list manipulation routines in ipx_pcb.c.
- Protect both IPX PCB state and SPX PCB state using the IPX PCB
mutex.
- Generally annotate locking, as well as adding liberal use of lock
assertions to document locking requirements.
- Where possible, use unlocked reads when reading integer or smaller
sized socket options on SPX sockets.
- De-spl throughout.
Notes:
- spx_input() expects both the list mutex and PCB mutex to be held
on entry, but will release both on return. Because sonewconn() is
called from spx_input(), it may actually drop one PCB lock and
acquire another during generation of a new connection, meaning the
caller is not in a position to unlock the PCB mutex.
MFC after: 3 weeks
Diffstat (limited to 'sys/netipx/ipx_input.c')
-rw-r--r-- | sys/netipx/ipx_input.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index ee1ca23..53d8d9a 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -277,8 +277,9 @@ ours: if ((ipxp->ipxp_flags & IPXP_ALL_PACKETS) == 0) switch (ipx->ipx_pt) { case IPXPROTO_SPX: + IPX_LOCK(ipxp); + /* Will release both locks. */ spx_input(m, ipxp); - IPX_LIST_UNLOCK(); return; } IPX_LOCK(ipxp); |