summaryrefslogtreecommitdiffstats
path: root/sys/netipx
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-06-15 03:51:44 +0000
committerrwatson <rwatson@FreeBSD.org>2004-06-15 03:51:44 +0000
commit029226f3a85acf1d4be6aa09215d8e97ded96cb0 (patch)
treed973d36efe46a45520c40d7d6276ec68a4318a28 /sys/netipx
parent586342bb6a2e371cab9eccaa57393f6aecbe3c3c (diff)
downloadFreeBSD-src-029226f3a85acf1d4be6aa09215d8e97ded96cb0.zip
FreeBSD-src-029226f3a85acf1d4be6aa09215d8e97ded96cb0.tar.gz
Grab the socket buffer send or receive mutex when performing a
read-modify-write on the sb_state field. This commit catches only the "easy" ones where it doesn't interact with as yet unmerged locking.
Diffstat (limited to 'sys/netipx')
-rw-r--r--sys/netipx/spx_usrreq.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index eb34fb7..b9c7a11 100644
--- a/sys/netipx/spx_usrreq.c
+++ b/sys/netipx/spx_usrreq.c
@@ -566,8 +566,11 @@ present:
cb->s_oobflags &= ~SF_IOOB;
if (so->so_rcv.sb_cc)
so->so_oobmark = so->so_rcv.sb_cc;
- else
+ else {
+ SOCKBUF_LOCK(&so->so_rcv);
so->so_rcv.sb_state |= SBS_RCVATMARK;
+ SOCKBUF_UNLOCK(&so->so_rcv);
+ }
}
q = q->si_prev;
remque(q->si_next);
@@ -597,7 +600,9 @@ present:
MCHTYPE(m, MT_OOBDATA);
spx_newchecks[1]++;
so->so_oobmark = 0;
+ SOCKBUF_LOCK(&so->so_rcv);
so->so_rcv.sb_state &= ~SBS_RCVATMARK;
+ SOCKBUF_UNLOCK(&so->so_rcv);
}
if (packetp == 0) {
m->m_data += SPINC;
OpenPOWER on IntegriCloud