summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authormichele <michele@openbsd.org>2007-05-22 10:20:55 +0000
committermichele <michele@openbsd.org>2007-05-22 10:20:55 +0000
commit7ca82f2de6c0197975aee65e0e8b8877ad431b1d (patch)
tree7811b16b4eb20f9c7c9f3a4d798fddce307f2009 /sys/netinet/tcp_input.c
parentzap double include; from p_nowaczyk AT o2.pl (diff)
downloadwireguard-openbsd-7ca82f2de6c0197975aee65e0e8b8877ad431b1d.tar.xz
wireguard-openbsd-7ca82f2de6c0197975aee65e0e8b8877ad431b1d.zip
When a partial ack is received check if congestion window is larger than
acked bytes and update the window accordingly fix PR4278 OK henning@ markus@ claudio@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index ad21ccc3fec..1dc889af11c 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.201 2007/02/13 06:39:50 itojun Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.202 2007/05/22 10:20:55 michele Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -3243,7 +3243,12 @@ tcp_newreno(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;
+
return 1;
}
return 0;