diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-24 02:57:12 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-24 02:57:12 +0000 |
commit | 60a4c150d340370b7b6f2d5b41101618182638fe (patch) | |
tree | 07b27d1e23cffcf83e3053d2a1cc5074ccc7e704 /sys/netinet/tcp_input.c | |
parent | 58e58438be556dbc83352153560dcafcd72c65c0 (diff) | |
download | FreeBSD-src-60a4c150d340370b7b6f2d5b41101618182638fe.zip FreeBSD-src-60a4c150d340370b7b6f2d5b41101618182638fe.tar.gz |
Protect so_oobmark with with SOCKBUF_LOCK(&so->so_rcv), and broaden
locking in tcp_input() for TCP packets with urgent data pointers to
hold the socket buffer lock across testing and updating oobmark
from just protecting sb_state.
Update socket locking annotations
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index cab3354..ef1d02c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2295,13 +2295,12 @@ step6: */ if (SEQ_GT(th->th_seq+th->th_urp, tp->rcv_up)) { tp->rcv_up = th->th_seq + th->th_urp; + SOCKBUF_LOCK(&so->so_rcv); so->so_oobmark = so->so_rcv.sb_cc + (tp->rcv_up - tp->rcv_nxt) - 1; - if (so->so_oobmark == 0) { - SOCKBUF_LOCK(&so->so_rcv); + if (so->so_oobmark == 0) so->so_rcv.sb_state |= SBS_RCVATMARK; - SOCKBUF_UNLOCK(&so->so_rcv); - } + SOCKBUF_UNLOCK(&so->so_rcv); sohasoutofband(so); tp->t_oobflags &= ~(TCPOOB_HAVEDATA | TCPOOB_HADDATA); } |