fixed bug #43192 tcp_enqueue_flags() should not check TCP_SND_QUEUELEN when sending FIN

This commit is contained in:
Simon Goldschmidt 2014-09-16 20:18:25 +02:00
parent 56c6301089
commit 085c1594de
2 changed files with 7 additions and 2 deletions

View File

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

View File

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