diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2024-11-05 08:52:42 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2024-11-05 08:52:42 +0000 |
commit | 625835c8b5e897e54a1a023788a3a9c3b16631c9 (patch) | |
tree | a44ce348697a736593f7707c8292cfc2d044f0f7 | |
parent | 55c854cf0c6aacb60ed88c02522377b1b3fa134d (diff) |
tcp: fix the initial CWND when a SYN retransmission happened
According to RFC 3390 the CWND should be set to one MSS if the
SYN or SYN-ACK has been retransmitted. This is handled in the
code by setting CWND to 1 and cc_conn_init() translates this
to MSS. Unfortunately, cc_cong_signal() was overwriting the
special value of 1 in case of a lost SYN, and therefore the
initial CWND was not as it was supposed to be.
Fix this by not overwriting the special value of 1.
Reviewed by: cc, rscheff
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D47439
-rw-r--r-- | sys/netinet/tcp_timer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index c5c65dda5b1a..4d8dafaec31d 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -810,7 +810,9 @@ tcp_timer_rexmt(struct tcpcb *tp) */ tp->t_rtttime = 0; - cc_cong_signal(tp, NULL, CC_RTO); + /* Do not overwrite the snd_cwnd on SYN retransmissions. */ + if (tp->t_state != TCPS_SYN_SENT) + cc_cong_signal(tp, NULL, CC_RTO); NET_EPOCH_ENTER(et); rv = tcp_output_locked(tp); NET_EPOCH_EXIT(et); |