diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-24 03:07:27 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-24 03:07:27 +0000 |
commit | 72e8ca6e165a24ed87c899be307e4741f3116434 (patch) | |
tree | f76180abe171351107cd600b668a7f9d290de65d /sys/netinet/tcp_reass.c | |
parent | 60a4c150d340370b7b6f2d5b41101618182638fe (diff) | |
download | FreeBSD-src-72e8ca6e165a24ed87c899be307e4741f3116434.zip FreeBSD-src-72e8ca6e165a24ed87c899be307e4741f3116434.tar.gz |
Broaden scope of the socket buffer lock when processing an ACK so that
the read and write of sb_cc are atomic. Call sbdrop_locked() instead
of sbdrop() since we already hold the socket buffer lock.
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r-- | sys/netinet/tcp_reass.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index ef1d02c..bc28ab1 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -2143,15 +2143,17 @@ process_ACK: incr = incr * incr / cw; tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale); } + SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { tp->snd_wnd -= so->so_snd.sb_cc; - sbdrop(&so->so_snd, (int)so->so_snd.sb_cc); + sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { - sbdrop(&so->so_snd, acked); + sbdrop_locked(&so->so_snd, acked); tp->snd_wnd -= acked; ourfinisacked = 0; } + SOCKBUF_UNLOCK(&so->so_snd); sowwakeup(so); /* detect una wraparound */ if ((tcp_do_newreno || tp->sack_enable) && |