mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-30 16:20:27 +00:00
Revert "tcp_abandon: no need to buffer pcb->local_port"
This reverts commit 1570dd8ad1c6afd2438dcb8b18d9eed794f78baa. Buffering pcb->local_port is needed because TCP_PCB_REMOVE_ACTIVE() sets it to 0 via tcp_pcb_remove() (comment: "reset the local port to prevent the pcb from being 'bound'"). Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
db46863f75
commit
7154e51ff2
@ -583,6 +583,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
tcp_free(pcb);
|
tcp_free(pcb);
|
||||||
} else {
|
} else {
|
||||||
int send_rst = 0;
|
int send_rst = 0;
|
||||||
|
u16_t local_port = 0;
|
||||||
enum tcp_state last_state;
|
enum tcp_state last_state;
|
||||||
seqno = pcb->snd_nxt;
|
seqno = pcb->snd_nxt;
|
||||||
ackno = pcb->rcv_nxt;
|
ackno = pcb->rcv_nxt;
|
||||||
@ -597,6 +598,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
send_rst = reset;
|
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) {
|
||||||
@ -613,7 +615,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
|||||||
tcp_backlog_accepted(pcb);
|
tcp_backlog_accepted(pcb);
|
||||||
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(pcb, seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port);
|
tcp_rst(pcb, seqno, ackno, &pcb->local_ip, &pcb->remote_ip, local_port, pcb->remote_port);
|
||||||
}
|
}
|
||||||
last_state = pcb->state;
|
last_state = pcb->state;
|
||||||
tcp_free(pcb);
|
tcp_free(pcb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user