]> Gentwo Git Trees - linux/.git/commit
selftest: packetdrill: Require explicit setsockopt(TCP_FASTOPEN).
authorKuniyuki Iwashima <kuniyu@google.com>
Sat, 27 Sep 2025 21:29:40 +0000 (21:29 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Sep 2025 01:41:07 +0000 (18:41 -0700)
commit261cb8b12376d1c06c2840280fc602dc065ed924
treecf0ad5172903d1ee6b9d011c8733322673e3858e
parent70dd4775db7fe33669bff6998e4b363298810127
selftest: packetdrill: Require explicit setsockopt(TCP_FASTOPEN).

To enable TCP Fast Open on a server, net.ipv4.tcp_fastopen must
have 0x2 (TFO_SERVER_ENABLE), and we need to do either

  1. Call setsockopt(TCP_FASTOPEN) for the socket
  2. Set 0x400 (TFO_SERVER_WO_SOCKOPT1) additionally to net.ipv4.tcp_fastopen

The default.sh sets 0x70403 so that each test does not need setsockopt().
(0x1 is TFO_CLIENT_ENABLE, and 0x70000 is ...???)

However, some tests overwrite net.ipv4.tcp_fastopen without
TFO_SERVER_WO_SOCKOPT1 and forgot setsockopt(TCP_FASTOPEN).

For example, pure-syn-data.pkt [0] tests non-TFO servers unintentionally,
except in the first scenario.

To prevent such an accident, let's require explicit setsockopt().

TFO_CLIENT_ENABLE is necessary for
tcp_syscall_bad_arg_fastopen-invalid-buf-ptr.pkt.

Link: https://github.com/google/packetdrill/blob/bfc96251310f/gtests/net/tcp/fastopen/server/opt34/pure-syn-data.pkt
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250927213022.1850048-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/packetdrill/defaults.sh