diff options
Diffstat (limited to 'tcp.c')
| -rw-r--r-- | tcp.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -2724,8 +2724,19 @@ void tcp_timer_handler(const struct ctx *c, union epoll_ref ref, flow_dbg(conn, "handshake timeout"); tcp_rst(c, conn, now); } else { + int flags = SYN; + flow_trace(conn, "SYN timeout, retry"); - if (tcp_send_flag(c, conn, SYN, now)) { + + /* Retransmit what we sent: a SYN-ACK if the + * guest initiated the connection, a SYN + * otherwise. Rewind to ISN at each retry. + */ + if (conn->events & TAP_SYN_RCVD) + flags |= ACK; + conn->seq_to_tap = conn->seq_ack_from_tap; + + if (tcp_send_flag(c, conn, flags, now)) { tcp_rst(c, conn, now); return; } |
