]> git.meshlink.io Git - utcp/commitdiff
Fix congestion window size after a triplicate ACK
authorGuus Sliepen <guus@sliepen.org>
Fri, 13 Mar 2020 07:45:44 +0000 (08:45 +0100)
committerGuus Sliepen <guus@sliepen.org>
Fri, 13 Mar 2020 07:45:44 +0000 (08:45 +0100)
utcp.c

diff --git a/utcp.c b/utcp.c
index 3a6c506062d70a26171f67c653ecea62a44c168c..d7bec9bc3fd244255a4021180178e0e97d60441a 100644 (file)
--- a/utcp.c
+++ b/utcp.c
@@ -1454,7 +1454,7 @@ synack:
 
                                // RFC 5681 fast recovery
                                c->snd.ssthresh = max(c->snd.cwnd / 2, utcp->mtu * 2); // eq. 4
-                               c->snd.cwnd = max(c->snd.ssthresh + 3 * utcp->mtu, c->sndbuf.maxsize);
+                               c->snd.cwnd = min(c->snd.ssthresh + 3 * utcp->mtu, c->sndbuf.maxsize);
 
                                if(c->snd.cwnd > c->sndbuf.maxsize) {
                                        c->snd.cwnd = c->sndbuf.maxsize;