Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftest: packetdrill: Add test for TFO_SERVER_WO_SOCKOPT1.

TFO_SERVER_WO_SOCKOPT1 is no longer enabled by default, and
each server test requires setsockopt(TCP_FASTOPEN).

Let's add a basic test for TFO_SERVER_WO_SOCKOPT1.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250927213022.1850048-6-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
399e0a7e 0b8f164e

+21
+21
tools/testing/selftests/net/packetdrill/tcp_fastopen_server_basic-no-setsockopt.pkt
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Basic TFO server test 4 + // 5 + // Test TFO_SERVER_WO_SOCKOPT1 without setsockopt(TCP_FASTOPEN) 6 + 7 + `./defaults.sh 8 + ./set_sysctls.py /proc/sys/net/ipv4/tcp_fastopen=0x402` 9 + 10 + 0 socket(..., SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 3 11 + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 12 + +0 bind(3, ..., ...) = 0 13 + +0 listen(3, 1) = 0 14 + 15 + +0 < S 0:10(10) win 32792 <mss 1460,sackOK,nop,nop,FO TFO_COOKIE,nop,nop> 16 + +0 > S. 0:0(0) ack 11 <mss 1460,nop,nop,sackOK> 17 + 18 + +0 accept(3, ..., ...) = 4 19 + +0 %{ assert (tcpi_options & TCPI_OPT_SYN_DATA) != 0, tcpi_options }% 20 + 21 + +0 read(4, ..., 512) = 10