fixed bug #38468 (tcp_sent() not called on half-open connection for data ACKed with the same ack as FIN)

This commit is contained in:
sg 2015-03-21 20:56:42 +01:00
parent 17486408b4
commit c00a62d37f
2 changed files with 17 additions and 12 deletions

View File

@ -216,6 +216,10 @@ HISTORY
++ Bugfixes:
2015-03-21: Simon Goldschmidt
* tcp_in.c: fixed bug #38468 (tcp_sent() not called on half-open connection for
data ACKed with the same ack as FIN)
2015-03-21: Simon Goldschmidt (patch by Christoffer Lind)
* dhcp.h/.c: fixed bug #38204 (DHCP lease time not handled correctly)

View File

@ -360,17 +360,6 @@ tcp_input(struct pbuf *p, struct netif *inp)
TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_RST);
tcp_pcb_remove(&tcp_active_pcbs, pcb);
memp_free(MEMP_TCP_PCB, pcb);
} else if (recv_flags & TF_CLOSED) {
/* The connection has been closed and we will deallocate the
PCB. */
if (!(pcb->flags & TF_RXCLOSED)) {
/* Connection closed although the application has only shut down the
tx side: call the PCB's err callback and indicate the closure to
ensure the application doesn't continue using the PCB. */
TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_CLSD);
}
tcp_pcb_remove(&tcp_active_pcbs, pcb);
memp_free(MEMP_TCP_PCB, pcb);
} else {
err = ERR_OK;
/* If the application has registered a "sent" function to be
@ -395,7 +384,19 @@ tcp_input(struct pbuf *p, struct netif *inp)
}
}
}
if (recv_flags & TF_CLOSED) {
/* The connection has been closed and we will deallocate the
PCB. */
if (!(pcb->flags & TF_RXCLOSED)) {
/* Connection closed although the application has only shut down the
tx side: call the PCB's err callback and indicate the closure to
ensure the application doesn't continue using the PCB. */
TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_CLSD);
}
tcp_pcb_remove(&tcp_active_pcbs, pcb);
memp_free(MEMP_TCP_PCB, pcb);
goto aborted;
}
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
while (recv_data != NULL) {
struct pbuf *rest = NULL;