mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 12:13:47 +00:00
tcp_abort/tcp_abandon: don't send RST if pcb->state is CLOSED
This commit is contained in:
parent
84d8760561
commit
dd245c63d7
@ -375,6 +375,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
tcp_pcb_remove(&tcp_tw_pcbs, pcb);
|
tcp_pcb_remove(&tcp_tw_pcbs, pcb);
|
||||||
memp_free(MEMP_TCP_PCB, pcb);
|
memp_free(MEMP_TCP_PCB, pcb);
|
||||||
} else {
|
} else {
|
||||||
|
int send_rst = reset && (pcb->state != CLOSED);
|
||||||
seqno = pcb->snd_nxt;
|
seqno = pcb->snd_nxt;
|
||||||
ackno = pcb->rcv_nxt;
|
ackno = pcb->rcv_nxt;
|
||||||
#if LWIP_CALLBACK_API
|
#if LWIP_CALLBACK_API
|
||||||
@ -393,7 +394,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
tcp_segs_free(pcb->ooseq);
|
tcp_segs_free(pcb->ooseq);
|
||||||
}
|
}
|
||||||
#endif /* TCP_QUEUE_OOSEQ */
|
#endif /* TCP_QUEUE_OOSEQ */
|
||||||
if (reset) {
|
if (send_rst) {
|
||||||
LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abandon: sending RST\n"));
|
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));
|
tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port, PCB_ISIPV6(pcb));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user