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
This commit is contained in:
Joel Cunningham 2017-08-09 16:28:55 -05:00
parent b8a3cf3a4a
commit 3d82155d29

View File

@ -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);