]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC 221209:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 10 Jun 2011 18:46:40 +0000 (18:46 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 10 Jun 2011 18:46:40 +0000 (18:46 +0000)
commitd9afe16c33479ff32ba8070202e140af4841000c
treef2011896cab700eba0f33b2edf804bd12fbd869c
parent33ae3d4cc35b52a767b1a349a8f016e97c1e8746
MFC 221209:
TCP reuses t_rxtshift to determine the backoff timer used for both the
persist state and the retransmit timer.  However, the code that implements
"bad retransmit recovery" only checks t_rxtshift to see if an ACK has been
received in during the first retransmit timeout window.  As a result, if
ticks has wrapped over to a negative value and a socket is in the persist
state, it can incorrectly treat an ACK from the remote peer as a
"bad retransmit recovery" and restore saved values such as snd_ssthresh and
snd_cwnd.  However, if the socket has never had a retransmit timeout, then
these saved values will be zero, so snd_ssthresh and snd_cwnd will be set
to 0.

If the socket is in fast recovery (this can be caused by excessive
duplicate ACKs such as those fixed by 220794), then each ACK that arrives
triggers either NewReno or SACK partial ACK handling which clamps snd_cwnd
to be no larger than snd_ssthresh.  In effect, the socket's send window
is permamently stuck at 0 even though the remote peer is advertising a
much larger window and pending data is only sent via TCP window probes
(so one byte every few seconds).

Fix this by adding a new TCP pcb flag (TF_PREVVALID) that indicates that
the various snd_*_prev fields in the pcb are valid and only perform
"bad retransmit recovery" if this flag is set in the pcb.  The flag is set
on the first retransmit timeout that occurs and is cleared on subsequent
retransmit timeouts or when entering the persist state.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222934 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netinet/tcp_input.c
sys/netinet/tcp_output.c
sys/netinet/tcp_timer.c
sys/netinet/tcp_var.h