Skip to content

Commit 67e2bb9

Browse files
nvmmaxNobody
authored andcommitted
bpf: Add selftests for raw syncookie helpers
This commit adds selftests for the new BPF helpers: bpf_tcp_raw_{gen,check}_syncookie_ipv{4,6}. xdp_synproxy_kern.c is a BPF program that generates SYN cookies on allowed TCP ports and sends SYNACKs to clients, accelerating synproxy iptables module. xdp_synproxy.c is a userspace control application that allows to configure the following options in runtime: list of allowed ports, MSS, window scale, TTL. test_xdp_synproxy.sh is a script that demonstrates the setup of synproxy with XDP acceleration and serves as a selftest for the new feature. Signed-off-by: Maxim Mikityanskiy <[email protected]> Reviewed-by: Tariq Toukan <[email protected]>
1 parent 70c741a commit 67e2bb9

File tree

5 files changed

+1243
-2
lines changed

5 files changed

+1243
-2
lines changed

tools/testing/selftests/bpf/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ test_cpp
4242
*.tmp
4343
xdpxceiver
4444
xdp_redirect_multi
45+
xdp_synproxy

tools/testing/selftests/bpf/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ TEST_PROGS := test_kmod.sh \
7272
test_bpftool.sh \
7373
test_bpftool_metadata.sh \
7474
test_doc_build.sh \
75-
test_xsk.sh
75+
test_xsk.sh \
76+
test_xdp_synproxy.sh
7677

7778
TEST_PROGS_EXTENDED := with_addr.sh \
7879
with_tunnels.sh \
@@ -82,7 +83,7 @@ TEST_PROGS_EXTENDED := with_addr.sh \
8283
TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
8384
flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \
8485
test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \
85-
xdpxceiver xdp_redirect_multi
86+
xdpxceiver xdp_redirect_multi xdp_synproxy
8687

8788
TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read
8889

0 commit comments

Comments
 (0)