Skip to content

Commit 794200d

Browse files
yuchungchengdavem330
authored andcommitted
tcp: undo cwnd on Fast Open spurious SYNACK retransmit
This patch makes passive Fast Open reverts the cwnd to default initial cwnd (10 packets) if the SYNACK timeout is spurious. Passive Fast Open uses a full socket during handshake so it can use the existing undo logic to detect spurious retransmission by recording the first SYNACK timeout in key state variable retrans_stamp. Upon receiving the ACK of the SYNACK, if the socket has sent some data before the timeout, the spurious timeout is detected by tcp_try_undo_recovery() in tcp_process_loss() in tcp_ack(). But if the socket has not send any data yet, tcp_ack() does not execute the undo code since no data is acknowledged. The fix is to check such case explicitly after tcp_ack() during the ACK processing in SYN_RECV state. In addition this is checked in FIN_WAIT_1 state in case the server closes the socket before handshake completes. Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8c3cfe1 commit 794200d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv4/tcp_input.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6089,6 +6089,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
60896089
* so release it.
60906090
*/
60916091
if (req) {
6092+
tcp_try_undo_loss(sk, false);
60926093
inet_csk(sk)->icsk_retransmits = 0;
60936094
reqsk_fastopen_remove(sk, req, false);
60946095
/* Re-arm the timer because data may have been sent out.
@@ -6143,6 +6144,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
61436144
* our SYNACK so stop the SYNACK timer.
61446145
*/
61456146
if (req) {
6147+
tcp_try_undo_loss(sk, false);
6148+
inet_csk(sk)->icsk_retransmits = 0;
61466149
/* We no longer need the request sock. */
61476150
reqsk_fastopen_remove(sk, req, false);
61486151
tcp_rearm_rto(sk);

0 commit comments

Comments
 (0)