selftests/bpf: Use connect_to_addr in connect_to_fd_opt
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 21 Jun 2024 02:15:59 +0000 (10:15 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 21 Jun 2024 03:42:44 +0000 (20:42 -0700)
commit08a5206240d3763e0c6d91a9a4a9bfbb8fc9600c
tree0cb06f343cabfca290a85b0a8efb4abb7791db0c
parent34ad6ec972525b903d4680202d7b8360f71d0d89
selftests/bpf: Use connect_to_addr in connect_to_fd_opt

This patch moves "post_socket_cb" and "noconnect" into connect_to_addr(),
then connect_to_fd_opts() can be implemented by getsockname() and
connect_to_addr(). This change makes connect_to_* interfaces more unified.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Link: https://lore.kernel.org/r/4569c30533e14c22fae6c05070aad809720551c1.1718932493.git.tanggeliang@kylinos.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/network_helpers.c