xref: /linux/tools/testing/selftests/net/packetdrill/tcp_ts_recent_reset_tsval.pkt (revision 0ad9617c78acbc71373fb341a6f75d4012b01d69)
1// SPDX-License-Identifier: GPL-2.0
2// Test that we send RST packet with correct TSval
3--tcp_ts_tick_usecs=1000
4
5`./defaults.sh`
6
7// Create a socket.
8    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
9   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
10
11   +0 bind(3, ..., ...) = 0
12   +0 listen(3, 1) = 0
13
14// Establish a connection.
15   +0 < S 0:0(0) win 20000 <mss 1000,sackOK,TS val 100 ecr 0>
16   +0 > S. 0:0(0) ack 1 <mss 1460,sackOK,TS val 100 ecr 100>
17  +.1 < . 1:1(0) ack 1 win 20000 <nop,nop,TS val 200 ecr 100>
18   +0 accept(3, ..., ...) = 4
19
20   +0 < . 1:1001(1000) ack 1 win 20000 <nop,nop,TS val 201 ecr 100>
21   +0 > . 1:1(0) ack 1001 <nop,nop,TS val 200 ecr 201>
22
23   +1 close(4) = 0
24// Check that RST TSval is updated properly, one second has passed since last sent packet.
25   +0 > R. 1:1(0) ack 1001 <nop,nop,TS val 1200 ecr 201>
26