From 5c68bbe16ffb2e091116cecf9aa9e85962c20e67 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 29 Sep 2011 21:12:34 +0200 Subject: [PATCH] Tried to fix bug #32417 ("TCP_OVERSIZE seems to have problems with (fast-)retransmission"): Reset pcb->unsent_oversize in 2 more places... --- CHANGELOG | 3 +++ src/core/tcp_in.c | 5 +++++ src/core/tcp_out.c | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 8138bbf7..36aafe7c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -69,6 +69,9 @@ HISTORY ++ Bugfixes: + 2011-09-27: Simon Goldschmidt + * tcp_in.c, tcp_out.c: Reset pcb->unsent_oversize in 2 more places... + 2011-09-27: Simon Goldschmidt * tcp_in.c: fixed bug #28288: Data after FIN in oos queue diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index df7c33dd..82ccedff 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -1090,6 +1090,11 @@ tcp_receive(struct tcp_pcb *pcb) next = pcb->unsent; pcb->unsent = pcb->unsent->next; +#if TCP_OVERSIZE + if (pcb->unsent == NULL) { + pcb->unsent_oversize = 0; + } +#endif /* TCP_OVERSIZE */ LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen)); LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p))); /* Prevent ACK for FIN to generate a sent event */ diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 2b1319c5..1a6ff53b 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -1256,6 +1256,7 @@ tcp_rexmit_rto(struct tcp_pcb *pcb) pcb->unsent = pcb->unacked; /* unacked queue is now empty */ pcb->unacked = NULL; + /* last unsent hasn't changed, no need to reset unsent_oversize */ /* increment number of retransmissions */ ++pcb->nrtx; @@ -1296,6 +1297,12 @@ tcp_rexmit(struct tcp_pcb *pcb) } seg->next = *cur_seg; *cur_seg = seg; +#if TCP_OVERSIZE + if (seg->next == NULL) { + /* the retransmitted segment is last in unsent, so reset unsent_oversize */ + pcb->unsent_oversize = 0; + } +#endif /* TCP_OVERSIZE */ ++pcb->nrtx;