Fixed bug in duplicate ack handling

(see http://www.sics.se/mailing-lists/lwip.html/msg01460.html)
Solution adds check on right window edge when duplicate ack received, if it is different it is not a duplicate.
This commit is contained in:
kieranm 2002-10-24 13:14:52 +00:00
parent ef6b7099ba
commit 4933bfaaa0

View File

@ -604,6 +604,8 @@ tcp_receive(struct tcp_pcb *pcb)
if(flags & TCP_ACK) {
unsigned long int right_wnd_edge = pcb->snd_wnd + pcb->snd_wl1;
/* Update window. */
if(TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
(pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
@ -623,6 +625,7 @@ tcp_receive(struct tcp_pcb *pcb)
if(pcb->lastack == ackno) {
if(pcb->snd_wl1+pcb->snd_wnd==right_wnd_edge){
++pcb->dupacks;
if(pcb->dupacks >= 3 && pcb->unacked != NULL) {
if(!(pcb->flags & TF_INFR)) {
@ -644,9 +647,12 @@ tcp_receive(struct tcp_pcb *pcb)
if((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
pcb->cwnd += pcb->mss;
}
}
}
}
else{
DEBUGF(TCP_FR_DEBUG, ("tcp_receive: dupack averted %lu %lu\n", pcb->snd_wl1+pcb->snd_wnd, right_wnd_edge));
}
} else if(TCP_SEQ_LT(pcb->lastack, ackno) &&
TCP_SEQ_LEQ(ackno, pcb->snd_max)) {
/* We come here when the ACK acknowledges new data. */