fixed bug #34636: FIN_WAIT_2 - Incorrect shutdown of TCP pcb: don't let PCBs time out from FIN_WAIT_2 if the RX side wasn't close (by either calling tcp_close or tcp_shutdown(RDWR))

This commit is contained in:
goldsimon 2012-01-21 18:05:15 +01:00
parent bec8cf9f38
commit 593f75fc3b
2 changed files with 12 additions and 4 deletions

View File

@ -62,6 +62,9 @@ HISTORY
++ Bugfixes: ++ Bugfixes:
2012-01-21: Simon Goldschmidt
* tcp.c: fixed bug #34636: FIN_WAIT_2 - Incorrect shutdown of TCP pcb
2012-01-20: Simon Goldschmidt 2012-01-20: Simon Goldschmidt
* dhcp.c: fixed bug #35151: DHCP asserts on incoming option lengths * dhcp.c: fixed bug #35151: DHCP asserts on incoming option lengths

View File

@ -872,10 +872,15 @@ tcp_slowtmr_start:
} }
/* Check if this PCB has stayed too long in FIN-WAIT-2 */ /* Check if this PCB has stayed too long in FIN-WAIT-2 */
if (pcb->state == FIN_WAIT_2) { if (pcb->state == FIN_WAIT_2) {
if ((u32_t)(tcp_ticks - pcb->tmr) > /* If this PCB is in FIN_WAIT_2 because of SHUT_WR don't let it time out. */
TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) { if (pcb->flags & TF_RXCLOSED) {
++pcb_remove; /* PCB was fully closed (either through close() or SHUT_RDWR):
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in FIN-WAIT-2\n")); normal FIN-WAIT timeout handling. */
if ((u32_t)(tcp_ticks - pcb->tmr) >
TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) {
++pcb_remove;
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in FIN-WAIT-2\n"));
}
} }
} }