selftests/bpf: Use connect_to_fd in test_tcp_check_syncookie
authorGeliang Tang <tanggeliang@kylinos.cn>
Sun, 5 May 2024 11:35:12 +0000 (19:35 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 9 May 2024 20:40:38 +0000 (13:40 -0700)
commit65a3f0df44dd3db0f77e6ccff0a126969abc0da4
treea233cb5a677e66f6c4e198e7b37e4439588f95de
parent5059c73eca67e686dea42af079c41857cb00a5a6
selftests/bpf: Use connect_to_fd in test_tcp_check_syncookie

This patch uses public helper connect_to_fd() exported in network_helpers.h
instead of the local defined function connect_to_server() in
test_tcp_check_syncookie_user.c. This can avoid duplicate code.

Then the arguments "addr" and "len" of run_test() become useless, drop them
too.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Link: https://lore.kernel.org/r/e0ae6b790ac0abc7193aadfb2660c8c9eb0fe1f0.1714907662.git.tanggeliang@kylinos.cn
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/test_tcp_check_syncookie_user.c