From 5cfef5bf48fc81a22f8cf79a3f8c0e1a8d2bbd9e 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 94ccbd5c..b461020d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -49,6 +49,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 4d5e1608..67e780e3 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -1078,6 +1078,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 d0ff42a4..8438eaf6 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -1250,6 +1250,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; @@ -1290,6 +1291,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;