tcp_proxy_client: tcp_close→tcp_abort, fix tw_pcbs loop

При CLOSE и FIN от сервера в обратном порядке (FIN relay + CLOSE от двух FIN),
клиент сначала обрабатывает CLOSE (tcp_close → TIME_WAIT), потом FIN
(tcp_shutdown на TIME_WAIT pcb), что портит tw_pcbs список — pcb->next
замыкается на себя, lwip_tcp_input зависает в бесконечном цикле.

tcp_abort шлёт RST и удаляет pcb сразу, без TIME_WAIT.
This commit is contained in:
Evgeny committed 2026-06-05 12:25:46 +03:00
1 parent 01dbd76834
commit 6f1916b6b2
1 file changed
+1 -1
+1 -1
View File
@@ -454,7 +454,7 @@ static void tcp_proxy_client_handle_close(struct tcp_proxy_client* p, uint32_t s
pc->rem_closed = 1;
if (pc->tx_buf) { u_free(pc->tx_buf); pc->tx_buf = NULL; pc->tx_len = 0; }
etcp_router_waiter_cancel(pc->proxy->inst, pc->proxy->via_node_id, &pc->tx_waiter);
if (pc->pcb) { tcp_arg(pc->pcb, NULL); tcp_close(pc->pcb); pc->pcb = NULL; }
if (pc->pcb) { tcp_arg(pc->pcb, NULL); tcp_abort(pc->pcb); pc->pcb = NULL; }
tcp_proxy_client_conn_free(pc);
}