summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index f5aa012..c86a3ec 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -3110,7 +3110,11 @@ tcp_newreno_partial_ack(tp, th)
* Partial window deflation. Relies on fact that tp->snd_una
* not updated yet.
*/
- tp->snd_cwnd -= (th->th_ack - tp->snd_una - tp->t_maxseg);
+ if (tp->snd_cwnd > th->th_ack - tp->snd_una)
+ tp->snd_cwnd -= th->th_ack - tp->snd_una;
+ else
+ tp->snd_cwnd = 0;
+ tp->snd_cwnd += tp->t_maxseg;
}
/*
OpenPOWER on IntegriCloud