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// Test the Experimental Option
4//
5// SYN w/ FOEXP w/o cookie must generates SYN+ACK w/ FOEXP
6// w/ a valid cookie, and the cookie must be the same one
7// with one generated by IANA FO
8
9`./defaults.sh`
10
11// Request a TFO cookie by Experimental Option
12// This must generate the same TFO_COOKIE
13 0 socket(..., SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 3
14 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
15 +0 bind(3, ..., ...) = 0
16 +0 listen(3, 1) = 0
17 +0 setsockopt(3, SOL_TCP, TCP_FASTOPEN, [1], 4) = 0
18
19 +0 < S 0:10(10) win 32792 <mss 1460,sackOK,nop,nop,FOEXP>
20 +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,FOEXP TFO_COOKIE>
21
22 +0 close(3) = 0
23
24// Test if FOEXP with a valid cookie creates a TFO socket
25 0 socket(..., SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 3
26 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
27 +0 bind(3, ..., ...) = 0
28 +0 listen(3, 1) = 0
29 +0 setsockopt(3, SOL_TCP, TCP_FASTOPEN, [1], 4) = 0
30
31 +0 < S 0:10(10) win 32792 <mss 1460,sackOK,nop,nop,FOEXP TFO_COOKIE>
32 +0 > S. 0:0(0) ack 11 <mss 1460,nop,nop,sackOK>
33
34 +0 accept(3, ..., ...) = 4
35 +0 %{ assert (tcpi_options & TCPI_OPT_SYN_DATA) != 0, tcpi_options }%
36
37 +0 read(4, ..., 512) = 10