From 245a6835f3e21412a05f4446c5d2ddfaad1d8bd2 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 15 Nov 2017 21:12:15 +0100 Subject: [PATCH] fixed bug #52403: netconn: FIN may be sent instead of RST when TCP netconn is closed with pending data in recv_mbox --- src/api/api_msg.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/api/api_msg.c b/src/api/api_msg.c index 023a4781..c6be8653 100644 --- a/src/api/api_msg.c +++ b/src/api/api_msg.c @@ -806,9 +806,6 @@ static void netconn_drain(struct netconn *conn) { void *mem; -#if LWIP_TCP - struct pbuf *p; -#endif /* LWIP_TCP */ /* This runs in tcpip_thread, so we don't need to lock against rx packets */ @@ -819,12 +816,7 @@ netconn_drain(struct netconn *conn) if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) { err_t err; if (!lwip_netconn_is_err_msg(mem, &err)) { - p = (struct pbuf *)mem; - /* pcb might be set to NULL already by err_tcp() */ - if (conn->pcb.tcp != NULL) { - tcp_recved(conn->pcb.tcp, p->tot_len); - } - pbuf_free(p); + pbuf_free((struct pbuf *)mem); } } else #endif /* LWIP_TCP */