This test checks syncookie mode is able to reconstruct some client options when TCP TS are used: - wscale option. - sackOK. - MSS (in a limited way). - ECN (not tested, because of limited value). Signed-off-by: Eric Dumazet --- .../net/packetdrill/tcp_syncookies_ip6_9k.pkt | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt diff --git a/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt new file mode 100644 index 0000000000000000000000000000000000000000..15d03992a99140ecc4241edae58693dc5098fece --- /dev/null +++ b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Check syncookies. +// +// Check we are able to rebuild client sack, wscale and mss options. +// IPv6 msstab[4] = { 1280 - 60, 1480 - 60, 1500 - 60, 9000 - 60 } + +--ip_version=ipv6 + +`./defaults.sh +sysctl -q net.ipv4.tcp_syncookies=2 +ip link set dev tun0 mtu 9000 +` + + 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 + +0 bind(3, ..., ...) = 0 + +0 listen(3, 10) = 0 + + +0 < S 0:0(0) win 32792 + +0 > S. 0:0(0) ack 1 + +.01 < . 1:1(0) ack 1 win 1024 + + +0 accept(3, ..., ...) = 4 + +// Check we properly infer from the final packet the other peer wanted 8940 mss, wscale 10 and sackOK + +0 %{ assert tcpi_snd_mss == 8928, tcpi_snd_mss }% + +0 %{ assert tcpi_snd_wscale = 10, tcpi_snd_wscale }% + +0 %{ assert (tcpi_options & TCPI_OPT_WSCALE) != 0, tcpi_options }% + -- 2.54.0.545.g6539524ca2-goog