net: tcp: Fixed forever loop in tcp_resend_data

Increments send retry every time
after the tcp_send_data when resending.
That way unhandled return values can time
out after set amount of tcp_retries.

Signed-off-by: Daniel Nejezchleb <dnejezchleb@hwg.cz>
This commit is contained in:
Daniel Nejezchleb 2022-02-03 14:46:26 +01:00 committed by Carles Cufí
parent 24478c8a4d
commit 208927d640

View file

@ -1126,9 +1126,8 @@ static void tcp_resend_data(struct k_work *work)
conn->unacked_len = 0;
ret = tcp_send_data(conn);
conn->send_data_retries++;
if (ret == 0) {
conn->send_data_retries++;
if (conn->in_close && conn->send_data_total == 0) {
NET_DBG("TCP connection in active close, "
"not disposing yet (waiting %dms)",