Skip to content

Commit 36ba590

Browse files
author
CKI Backport Bot
committed
selftest: packetdrill: Import client-ack-dropped-then-recovery-ms-timestamps.pkt
JIRA: https://issues.redhat.com/browse/RHEL-124166 commit 9b62d53 Author: Kuniyuki Iwashima <kuniyu@google.com> Date: Sat Sep 27 21:29:51 2025 +0000 selftest: packetdrill: Import client-ack-dropped-then-recovery-ms-timestamps.pkt This also does not have the non-experimental version, so converted to FO. The comment in .pkt explains the detailed scenario. Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20250927213022.1850048-14-kuniyu@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 4eb81b8 commit 36ba590

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
//
3+
// A reproducer case for a TFO SYNACK RTO undo bug in:
4+
// 794200d66273 ("tcp: undo cwnd on Fast Open spurious SYNACK retransmit")
5+
// This sequence that tickles this bug is:
6+
// - Fast Open server receives TFO SYN with data, sends SYNACK
7+
// - (client receives SYNACK and sends ACK, but ACK is lost)
8+
// - server app sends some data packets
9+
// - (N of the first data packets are lost)
10+
// - server receives client ACK that has a TS ECR matching first SYNACK,
11+
// and also SACKs suggesting the first N data packets were lost
12+
// - server performs undo of SYNACK RTO, then immediately enters recovery
13+
// - buggy behavior in 794200d66273 then performed an undo that caused
14+
// the connection to be in a bad state, in CA_Open with retrans_out != 0
15+
16+
// Check that outbound TS Val ticks are as we would expect with 1000 usec per
17+
// timestamp tick:
18+
--tcp_ts_tick_usecs=1000
19+
20+
`./defaults.sh`
21+
22+
// Initialize connection
23+
0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
24+
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
25+
+0 setsockopt(3, SOL_TCP, TCP_FASTOPEN, [1], 4) = 0
26+
+0 bind(3, ..., ...) = 0
27+
+0 listen(3, 1) = 0
28+
29+
+0 < S 0:1000(1000) win 65535 <mss 1012,sackOK,TS val 1000 ecr 0,wscale 7,nop,nop,nop,FO TFO_COOKIE>
30+
+0 > S. 0:0(0) ack 1001 <mss 1460,sackOK,TS val 2000 ecr 1000,nop,wscale 8>
31+
+0 accept(3, ..., ...) = 4
32+
33+
// Application writes more data
34+
+.010 write(4, ..., 10000) = 10000
35+
+0 > P. 1:5001(5000) ack 1001 <nop,nop,TS val 2010 ecr 1000>
36+
+0 > P. 5001:10001(5000) ack 1001 <nop,nop,TS val 2010 ecr 1000>
37+
+0 %{ assert tcpi_snd_cwnd == 10, tcpi_snd_cwnd }%
38+
39+
+0 < . 1001:1001(0) ack 1 win 257 <TS val 1010 ecr 2000,sack 2001:5001>
40+
+0 > P. 1:2001(2000) ack 1001 <nop,nop,TS val 2010 ecr 1010>
41+
+0 %{ assert tcpi_ca_state == TCP_CA_Recovery, tcpi_ca_state }%
42+
+0 %{ assert tcpi_snd_cwnd == 7, tcpi_snd_cwnd }%
43+
44+
+0 < . 1001:1001(0) ack 1 win 257 <TS val 1011 ecr 2000,sack 2001:6001>
45+
+0 %{ assert tcpi_ca_state == TCP_CA_Recovery, tcpi_ca_state }%
46+
+0 %{ assert tcpi_snd_cwnd == 7, tcpi_snd_cwnd }%

0 commit comments

Comments
 (0)