xref: /linux/tools/testing/selftests/net/packetdrill/tcp_sack_sack-route-refresh-ip-tos.pkt (revision 0ad9617c78acbc71373fb341a6f75d4012b01d69)
1// SPDX-License-Identifier: GPL-2.0
2// Verify that setsockopt calls that force a route refresh do not
3// cause problems matching SACKs with packets in the write queue.
4// This variant tests IP_TOS.
5
6`./defaults.sh`
7
8// Establish a connection.
9    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
10   +0 setsockopt(3, SOL_IP, IP_MTU_DISCOVER, [IP_PMTUDISC_DONT], 1) = 0
11   +0...0.010 connect(3, ..., ...) = 0
12
13   +0 > S 0:0(0) <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8>
14 +.01 < S. 0:0(0) ack 1 win 65535 <mss 1460,nop,wscale 2,nop,nop,sackOK>
15   +0 > . 1:1(0) ack 1
16
17 +.01 write(3, ..., 5840) = 5840
18   +0 > P. 1:5841(5840) ack 1
19 +.01 < . 1:1(0) ack 5841 win 65535
20
21 +.01 write(3, ..., 5840) = 5840
22   +0 > P. 5841:11681(5840) ack 1
23 +.01 < . 1:1(0) ack 11681 win 65535
24
25 +.01 write(3, ..., 14600) = 14600
26   +0 > P. 11681:26281(14600) ack 1
27
28// Try the socket option that we know can force a route refresh.
29   +0 setsockopt(3, SOL_IP, IP_TOS, [4], 1) = 0
30// Then revert to avoid routing/mangling/etc implications of that setting.
31   +0 setsockopt(3, SOL_IP, IP_TOS, [0], 1) = 0
32
33// Verify that we do not retransmit the SACKed segments.
34 +.01 < . 1:1(0) ack 13141 win 65535 <sack 16061:17521 20441:26281,nop,nop>
35   +0 > . 13141:16061(2920) ack 1
36   +0 > P. 17521:20441(2920) ack 1
37 +.01 < . 1:1(0) ack 26281 win 65535
38