From 6c0d78caaa8c1b4c23b0444ac5352d63257ff71b Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 19 Jul 2016 09:05:48 +0200 Subject: [PATCH] Fixed trying to send RST for unconnected (but bound) pcb --- src/core/tcp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index 0bc171c5..040d7a0f 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -464,9 +464,11 @@ tcp_abandon(struct tcp_pcb *pcb, int reset) errf = pcb->errf; #endif /* LWIP_CALLBACK_API */ errf_arg = pcb->callback_arg; - if ((pcb->state == CLOSED) && (pcb->local_port != 0)) { - /* bound, not yet opened */ - TCP_RMV(&tcp_bound_pcbs, pcb); + if (pcb->state == CLOSED) { + if (pcb->local_port != 0) { + /* bound, not yet opened */ + TCP_RMV(&tcp_bound_pcbs, pcb); + } } else { send_rst = reset; local_port = pcb->local_port;