From 61a36e3dfc9c0ae705d582a07752c26b71855c8d Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Tue, 20 Jan 2004 21:40:25 +0000 Subject: [PATCH] Merge from DragonFlyBSD rev 1.10: date: 2003/09/02 10:04:47; author: hsu; state: Exp; lines: +5 -6 Account for when Limited Transmit is not congestion window limited. Obtained from: DragonFlyBSD --- sys/netinet/tcp_input.c | 11 +++++------ sys/netinet/tcp_reass.c | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 263dfd83f163..eef736cf34bc 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1859,13 +1859,12 @@ tcp_input(m, off0) KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, ("dupacks not 1 or 2")); - if (tp->t_dupacks == 1) { + if (tp->t_dupacks == 1) tp->snd_limited = 0; - tp->snd_cwnd += tp->t_maxseg; - } else { - tp->snd_cwnd += - tp->t_maxseg * 2; - } + tp->snd_cwnd = + (tp->snd_nxt - tp->snd_una) + + (tp->t_dupacks - tp->snd_limited) * + tp->t_maxseg; (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 263dfd83f163..eef736cf34bc 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1859,13 +1859,12 @@ tcp_input(m, off0) KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, ("dupacks not 1 or 2")); - if (tp->t_dupacks == 1) { + if (tp->t_dupacks == 1) tp->snd_limited = 0; - tp->snd_cwnd += tp->t_maxseg; - } else { - tp->snd_cwnd += - tp->t_maxseg * 2; - } + tp->snd_cwnd = + (tp->snd_nxt - tp->snd_una) + + (tp->t_dupacks - tp->snd_limited) * + tp->t_maxseg; (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) {