Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1// SPDX-License-Identifier: GPL-2.0
2//
3// Basic TFO server test
4//
5// Test TFO_SERVER_COOKIE_NOT_REQD flag on receiving
6// SYN with data but without Fast Open cookie option.
7
8`./defaults.sh
9 ./set_sysctls.py /proc/sys/net/ipv4/tcp_fastopen=0x202`
10
11 0 socket(..., SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 3
12 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
13 +0 bind(3, ..., ...) = 0
14 +0 listen(3, 1) = 0
15 +0 setsockopt(3, SOL_TCP, TCP_FASTOPEN, [1], 4) = 0
16
17// Since TFO_SERVER_COOKIE_NOT_REQD, a TFO socket will be created with
18// the data accepted.
19 +0 < S 0:1000(1000) win 32792 <mss 1460,sackOK,nop,nop>
20 +0 > S. 0:0(0) ack 1001 <mss 1460,nop,nop,sackOK>
21 +0 accept(3, ..., ...) = 4
22 +0 %{ assert (tcpi_options & TCPI_OPT_SYN_DATA) != 0, tcpi_options }%
23 +0 read(4, ..., 1024) = 1000
24
25// Data After SYN will be accepted too.
26 +0 < . 1001:2001(1000) ack 1 win 5840
27 +0 > . 1:1(0) ack 2001
28
29// Should change the implementation later to set the SYN flag as well.
30 +0 read(4, ..., 1024) = 1000
31 +0 write(4, ..., 1000) = 1000
32 +0 > P. 1:1001(1000) ack 2001