Skip to content

Commit 8c3cfe1

Browse files
yuchungchengdavem330
authored andcommitted
tcp: lower congestion window on Fast Open SYNACK timeout
TCP sender would use congestion window of 1 packet on the second SYN and SYNACK timeout except passive TCP Fast Open. This makes passive TFO too aggressive and unfair during congestion at handshake. This patch fixes this issue so TCP (fast open or not, passive or active) always conforms to the RFC6298. Note that tcp_enter_loss() is called only once during recurring timeouts. This is because during handshake, high_seq and snd_una are the same so tcp_enter_loss() would incorrect set the undo state variables multiple times. Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 336c39a commit 8c3cfe1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv4/tcp_timer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ static void tcp_fastopen_synack_timer(struct sock *sk)
393393
tcp_write_err(sk);
394394
return;
395395
}
396+
/* Lower cwnd after certain SYNACK timeout like tcp_init_transfer() */
397+
if (icsk->icsk_retransmits == 1)
398+
tcp_enter_loss(sk);
396399
/* XXX (TFO) - Unlike regular SYN-ACK retransmit, we ignore error
397400
* returned from rtx_syn_ack() to make it more persistent like
398401
* regular retransmit because if the child socket has been accepted

0 commit comments

Comments
 (0)