tcp: fastopen: fix rcv_wup initialization for TFO server on SYN/data
Subsystems (3)
Neal Cardwell
maintainerPATCH 1/1 tcp: fastopen: fix rcv_wup initialization for TFO server on SYN/data
Yuchung noticed that on the first TFO server data packet sent after the (TFO) handshake, the server echoed the TCP timestamp value in the SYN/data instead of the timestamp value in the final ACK of the handshake. This problem did not happen on regular opens.
The tcp_replace_ts_recent() logic that decides whether to remember an incoming TS value needs tp->rcv_wup to hold the latest receive sequence number that we have ACKed (latest tp->rcv_nxt we have ACKed). This commit fixes this issue by ensuring that a TFO server properly updates tp->rcv_wup to match tp->rcv_nxt at the time it sends a SYN/ACK for the SYN/data.
--- net/ipv4/tcp_fastopen.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/tcp_fastopen.c +1 -0
@@ -226,6 +226,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk,tcp_fastopen_add_skb (child, skb);tcp_rsk (req)->rcv_nxt = tp->rcv_nxt; + tp->rcv_wup = tp->rcv_nxt;/* tcp_conn_request() is sending the SYNACK, * and queues the child into listener accept queue. */
Signature · 1 line
2.8.0.rc3.226.g39d4020
Neal Cardwell
maintainerSorry, there's a typo in the subject line: that should be "net" rather than "next" (I'm proposing "net" since it's a bug fix).
Looks like "git am" strips this mistake, but I'm happy to resubmit if it helps.
thanks,
neal
From: Neal Cardwell <[email protected]>
Date: Tue, 30 Aug 2016 11:55:23 -0400
Quoted 12 lines
Yuchung noticed that on the first TFO server data packet sent after the (TFO) handshake, the server echoed the TCP timestamp value in the SYN/data instead of the timestamp value in the final ACK of the handshake. This problem did not happen on regular opens.
The
tcp_replace_ts_recent()logic that decides whether to remember an incoming TS value needstp->rcv_wupto hold the latest receive sequence number that we have ACKed (latesttp->rcv_nxtwe have ACKed). This commit fixes this issue by ensuring that a TFO server properly updatestp->rcv_wupto matchtp->rcv_nxtat the time it sends a SYN/ACK for the SYN/data.
Quoted 6 lines
Reported-by Yuchung Cheng <[email protected]>Signed-off-by Neal Cardwell <[email protected]>Signed-off-by Yuchung Cheng <[email protected]>Signed-off-by Eric Dumazet <[email protected]>Signed-off-by Soheil Hassas Yeganeh <[email protected]>Fixes 168a8f58059a ("tcp: TCP Fast Open Server - main code path")
Applied to 'net', thanks.