forked from Imagelibrary/lwip
tcp_abort/tcp_abandon: don't send RST if pcb->state is CLOSED
This commit is contained in:
@@ -375,6 +375,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
||||
tcp_pcb_remove(&tcp_tw_pcbs, pcb);
|
||||
memp_free(MEMP_TCP_PCB, pcb);
|
||||
} else {
|
||||
int send_rst = reset && (pcb->state != CLOSED);
|
||||
seqno = pcb->snd_nxt;
|
||||
ackno = pcb->rcv_nxt;
|
||||
#if LWIP_CALLBACK_API
|
||||
@@ -393,7 +394,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
||||
tcp_segs_free(pcb->ooseq);
|
||||
}
|
||||
#endif /* TCP_QUEUE_OOSEQ */
|
||||
if (reset) {
|
||||
if (send_rst) {
|
||||
LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abandon: sending RST\n"));
|
||||
tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port, PCB_ISIPV6(pcb));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user