From 3d82155d29c6ae0e1dd1d5cc42ee914f52952c75 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Wed, 9 Aug 2017 16:28:55 -0500 Subject: [PATCH] tcp: use TCP_WND_INC for dupack > 3 case TCP_WND_INC abstracts the rollover handling and allows the window to reach it's maximum value --- src/core/tcp_in.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index ff29b32f..5f60b06f 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -1168,11 +1168,8 @@ tcp_receive(struct tcp_pcb *pcb) ++pcb->dupacks; } if (pcb->dupacks > 3) { - /* Inflate the congestion window, but not if it means that - the value overflows. */ - if ((tcpwnd_size_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) { - pcb->cwnd = (tcpwnd_size_t)(pcb->cwnd + pcb->mss); - } + /* Inflate the congestion window */ + TCP_WND_INC(pcb->cwnd, pcb->mss); } else if (pcb->dupacks >= 3) { /* Do fast retransmit (checked via TF_INFR, not via dupacks count) */ tcp_rexmit_fast(pcb);