From 085c1594de4d69b50d26f0881526ac3d1c181aed Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Tue, 16 Sep 2014 20:18:25 +0200 Subject: [PATCH] fixed bug #43192 tcp_enqueue_flags() should not check TCP_SND_QUEUELEN when sending FIN --- CHANGELOG | 4 ++++ src/core/tcp_out.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 226be957..ca99d565 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -127,6 +127,10 @@ HISTORY ++ Bugfixes: + 2014-09-16: Simon Goldschmidt + * tcp_out.c: fixed bug #43192 tcp_enqueue_flags() should not check TCP_SND_QUEUELEN + when sending FIN + 2014-09-03: Simon Goldschmidt * msg_in.c: fixed bug #39355 SNMP Memory Leak in case of error diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index bd063c82..c33a2617 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -745,8 +745,9 @@ tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags) LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)", (flags & (TCP_SYN | TCP_FIN)) != 0); - /* check for configured max queuelen and possible overflow */ - if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) { + /* check for configured max queuelen and possible overflow (FIN flag should always come through!) */ + if (((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) && + ((flags & TCP_FIN) == 0)) { LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue_flags: too long queue %"U16_F" (max %"U16_F")\n", pcb->snd_queuelen, TCP_SND_QUEUELEN)); TCP_STATS_INC(tcp.memerr);