aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_tcp_custom_syncookie.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <[email protected]>2024-01-15 20:55:09 +0000
committerAlexei Starovoitov <[email protected]>2024-01-23 22:40:23 +0000
commitb18afb6f42292a9154102fed7265ae747bbfbc57 (patch)
treecdca19b0c57e2ab62989866c8a7eddcab25ea338 /tools/testing/selftests/bpf/progs/test_tcp_custom_syncookie.c
parentselftests/bpf: Fix potential premature unload in bpf_testmod (diff)
downloadkernel-b18afb6f42292a9154102fed7265ae747bbfbc57.tar.gz
kernel-b18afb6f42292a9154102fed7265ae747bbfbc57.zip
tcp: Move tcp_ns_to_ts() to tcp.h
We will support arbitrary SYN Cookie with BPF. When BPF prog validates ACK and kfunc allocates a reqsk, we need to call tcp_ns_to_ts() to calculate an offset of TSval for later use: time t0 : Send SYN+ACK -> tsval = Initial TSval (Random Number) t1 : Recv ACK of 3WHS -> tsoff = TSecr - tcp_ns_to_ts(usec_ts_ok, tcp_clock_ns()) = Initial TSval - t1 t2 : Send ACK -> tsval = t2 + tsoff = Initial TSval + (t2 - t1) = Initial TSval + Time Delta (x) (x) Note that the time delta does not include the initial RTT from t0 to t1. Let's move tcp_ns_to_ts() to tcp.h. Signed-off-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_tcp_custom_syncookie.c')
0 files changed, 0 insertions, 0 deletions