mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
Fixed bug #45161 tcp.c / tcp_abandon / pcb->local_port set to zero but needed later for tcp_rst (introduced some months ago when fixing bug #42299)
This commit is contained in:
parent
de83c3e9e0
commit
392ef77bc5
@ -377,7 +377,8 @@ 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);
|
int send_rst = 0;
|
||||||
|
u16_t local_port = 0;
|
||||||
seqno = pcb->snd_nxt;
|
seqno = pcb->snd_nxt;
|
||||||
ackno = pcb->rcv_nxt;
|
ackno = pcb->rcv_nxt;
|
||||||
#if LWIP_CALLBACK_API
|
#if LWIP_CALLBACK_API
|
||||||
@ -388,6 +389,8 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
/* bound, not yet opened */
|
/* bound, not yet opened */
|
||||||
TCP_RMV(&tcp_bound_pcbs, pcb);
|
TCP_RMV(&tcp_bound_pcbs, pcb);
|
||||||
} else {
|
} else {
|
||||||
|
send_rst = reset;
|
||||||
|
local_port = pcb->local_port;
|
||||||
TCP_PCB_REMOVE_ACTIVE(pcb);
|
TCP_PCB_REMOVE_ACTIVE(pcb);
|
||||||
}
|
}
|
||||||
if (pcb->unacked != NULL) {
|
if (pcb->unacked != NULL) {
|
||||||
@ -403,7 +406,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
#endif /* TCP_QUEUE_OOSEQ */
|
#endif /* TCP_QUEUE_OOSEQ */
|
||||||
if (send_rst) {
|
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);
|
tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, local_port, pcb->remote_port);
|
||||||
}
|
}
|
||||||
memp_free(MEMP_TCP_PCB, pcb);
|
memp_free(MEMP_TCP_PCB, pcb);
|
||||||
TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);
|
TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user