From: Guus Sliepen Date: Thu, 10 Oct 2019 20:10:44 +0000 (+0200) Subject: Correctly handle incoming retransmissions of SYN packets. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=25675cca79330f968b3fb106793a5265615f4df7;p=utcp Correctly handle incoming retransmissions of SYN packets. --- diff --git a/utcp.c b/utcp.c index ac162fe..f35f965 100644 --- a/utcp.c +++ b/utcp.c @@ -1055,6 +1055,7 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { c->flags = UTCP_TCP; } +synack: // Return SYN+ACK, go to SYN_RECEIVED state c->snd.wnd = hdr.wnd; c->rcv.irs = hdr.seq; @@ -1410,6 +1411,9 @@ skip_ack: break; case SYN_RECEIVED: + // This is a retransmit of a SYN, send back the SYNACK. + goto synack; + case ESTABLISHED: case FIN_WAIT_1: case FIN_WAIT_2: