diff --git a/CHANGELOG b/CHANGELOG index c460a010..47c9e295 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,8 +11,12 @@ FUTURE HISTORY + 2005-12-20 Leon Woestenberg + * tcp.c: Remove PCBs which stay in LAST_ACK state too long. Patch + submitted by Mitrani Hiroshi. + 2005-12-15 Christiaan Simons - * inet.c: Standard checksum routine fixed in proper portable C. + * inet.c: Disabled the added summing routine to preserve code space. 2005-12-14 Leon Woestenberg * inet.c: Duplicate FIN ACK race condition fix by Kelvin Lawson. diff --git a/src/core/tcp.c b/src/core/tcp.c index f07ad06e..41a9edb4 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -555,12 +555,19 @@ tcp_slowtmr(void) /* Check if this PCB has stayed too long in SYN-RCVD */ if (pcb->state == SYN_RCVD) { if ((u32_t)(tcp_ticks - pcb->tmr) > - TCP_SYN_RCVD_TIMEOUT / TCP_SLOW_INTERVAL) { + TCP_SYN_RCVD_TIMEOUT / TCP_SLOW_INTERVAL) { ++pcb_remove; LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in SYN-RCVD\n")); } } + /* Check if this PCB has stayed too long in LAST-ACK */ + if (pcb->state == LAST_ACK) { + if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { + ++pcb_remove; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in LAST-ACK\n")); + } + } /* If the PCB should be removed, do it. */ if (pcb_remove) {