Fix a bug in syncache where the initial CWND for new incoming connections

was limited to one segment under the faulty assumption of a retransmit.
Due to this the opportunity to initialize the increased congestion window
according to RFC3390 was missed.

Support for RFC3465 introduced in r187289 uncovered the bug as the ACK
to SYN/ACK no longer caused snd_cwnd increase by MSS (actually, this
increase shouldn't happen as it's explicitly forbidden by RFC3390, but
it's another issue).  Snd_cwnd remains really small (1*MSS + 1) and this
causes really bad interaction with delayed acks on other side.

The variable name sc_rxmits is a bit misleading as it counts all transmits,
not just retransmits.

Submitted by:	Maxim Dounin <mdounin-at-mdounin-dot-ru>
MFC after:	10 days
This commit is contained in:
andre 2010-07-30 21:45:53 +00:00
parent 67a2e7219e
commit 92e9dbc518

View File

@ -804,8 +804,9 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
/*
* If the SYN,ACK was retransmitted, reset cwnd to 1 segment.
* NB: sc_rxmits counts all SYN,ACK transmits, not just retransmits.
*/
if (sc->sc_rxmits)
if (sc->sc_rxmits > 1)
tp->snd_cwnd = tp->t_maxseg;
tcp_timer_activate(tp, TT_KEEP, tcp_keepinit);