]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftest: packetdrill: Define common TCP Fast Open cookie.
authorKuniyuki Iwashima <kuniyu@google.com>
Sat, 27 Sep 2025 21:29:41 +0000 (21:29 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Sep 2025 01:41:19 +0000 (18:41 -0700)
commit97b3b8306f782af80b4666d7137c75be9dba9219
treeea23a9180cbfdbc9ab66694f6959332fb7ac9239
parent261cb8b12376d1c06c2840280fc602dc065ed924
selftest: packetdrill: Define common TCP Fast Open cookie.

TCP Fast Open cookie is generated in __tcp_fastopen_cookie_gen_cipher().

The cookie value is generated from src/dst IPs and a key configured by
setsockopt(TCP_FASTOPEN_KEY) or net.ipv4.tcp_fastopen_key.

The default.sh sets net.ipv4.tcp_fastopen_key, and the original packetdrill
defines the corresponding cookie as TFO_COOKIE in run_all.py. [0]

Then, each test does not need to care about the value, and we can easily
update TFO_COOKIE in case __tcp_fastopen_cookie_gen_cipher() changes the
algorithm.

However, some tests use the bare hex value for specific IPv4 addresses
and do not support IPv6.

Let's define the same TFO_COOKIE in ksft_runner.sh.

We will replace such bare hex values with TFO_COOKIE except for a single
test for setsockopt(TCP_FASTOPEN_KEY).

Link: https://github.com/google/packetdrill/blob/7230b3990f94/gtests/net/packetdrill/run_all.py#L65
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250927213022.1850048-4-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/packetdrill/defaults.sh
tools/testing/selftests/net/packetdrill/ksft_runner.sh