mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-02 14:58:22 +00:00
Check that tcp_abort/tcp_abandon isn't called for listen-pcbs
This commit is contained in:
parent
d2c632fb18
commit
49e8e28cf6
@ -317,7 +317,9 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
#endif /* LWIP_CALLBACK_API */
|
#endif /* LWIP_CALLBACK_API */
|
||||||
void *errf_arg;
|
void *errf_arg;
|
||||||
|
|
||||||
|
/* pcb->state LISTEN not allowed here */
|
||||||
|
LWIP_ASSERT("don't call tcp_abort/tcp_abandon for listen-pcbs",
|
||||||
|
pcb->state != LISTEN);
|
||||||
/* Figure out on which TCP PCB list we are, and remove us. If we
|
/* Figure out on which TCP PCB list we are, and remove us. If we
|
||||||
are in an active state, call the receive function associated with
|
are in an active state, call the receive function associated with
|
||||||
the PCB with a NULL argument, and send an RST to the remote end. */
|
the PCB with a NULL argument, and send an RST to the remote end. */
|
||||||
@ -325,7 +327,6 @@ 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 {
|
||||||
/* @todo: pcb->state, LISTEN not allowed */
|
|
||||||
seqno = pcb->snd_nxt;
|
seqno = pcb->snd_nxt;
|
||||||
ackno = pcb->rcv_nxt;
|
ackno = pcb->rcv_nxt;
|
||||||
ip_addr_copy(local_ip, pcb->local_ip);
|
ip_addr_copy(local_ip, pcb->local_ip);
|
||||||
|
Loading…
Reference in New Issue
Block a user