From c82f376de8d2cf8b267234ab0f4d61dfeedefaf4 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 11 Apr 2012 18:05:04 +0800 Subject: [PATCH] tcp: RW=min(IW,cwnd) is standardized in RFC5681 --- sys/netinet/tcp_output.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index ef137efa88..975072b5ba 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -187,14 +187,13 @@ tcp_output(struct tcpcb *tp) */ if (tp->snd_max == tp->snd_una && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) { - if (tcp_do_rfc3390 && !(tp->t_flags & TF_SYN_WASLOST)) { - int initial_cwnd = - min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); + u_long initial_cwnd = tcp_initial_window(tp); - tp->snd_cwnd = min(tp->snd_cwnd, initial_cwnd); - } else { - tp->snd_cwnd = tp->t_maxseg; - } + /* + * According to RFC5681: + * RW=min(IW,cwnd) + */ + tp->snd_cwnd = min(tp->snd_cwnd, initial_cwnd); tp->snd_wacked = 0; } -- 2.41.0