diff --git a/src/core/tcp.c b/src/core/tcp.c index fa5f1b11..00de06ec 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1635,7 +1635,7 @@ tcp_kill_prio(u8_t prio) mprio = LWIP_MIN(TCP_PRIO_MAX, prio); - /* We kill the oldest active connection that has lower priority than prio. */ + /* We kill the oldest active connection that has the same or lower priority than prio. */ inactivity = 0; inactive = NULL; for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { @@ -1742,8 +1742,8 @@ tcp_alloc(u8_t prio) /* Try to allocate a tcp_pcb again. */ pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); if (pcb == NULL) { - /* Try killing active connections with lower priority than the new one. */ - LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing connection with prio lower than %d\n", prio)); + /* Try killing oldest active connection with the same or lower priority than the new one. */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing oldest connection with prio same/lower than %d\n", prio)); tcp_kill_prio(prio); /* Try to allocate a tcp_pcb again. */ pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB);