diff options
author | Geliang Tang <tanggeliang@kylinos.cn> | 2024-04-25 11:23:43 +0800 |
---|---|---|
committer | Martin KaFai Lau <martin.lau@kernel.org> | 2024-04-30 16:01:30 -0700 |
commit | 8405e6980f21e2b75f232e970edd76bc50cf1491 (patch) | |
tree | ac0583a8b1aab0fd602c83895039ac11a0675f7c /tools/testing/selftests/bpf | |
parent | 044032ee6c4e786746058aaf5527be13e831cc5c (diff) |
selftests/bpf: Drop start_server_proto helper
Protocol can be set by __start_server() helper directly now, this makes
the heler start_server_proto() useless.
This patch drops it, and implenments start_server() using make_sockaddr()
and __start_server().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Link: https://lore.kernel.org/r/55d8a04e0bb8240a5fda2da3e9bdffe6fc8547b2.1714014697.git.tanggeliang@kylinos.cn
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf')
-rw-r--r-- | tools/testing/selftests/bpf/network_helpers.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c index aa23692029c4..054d26e383e0 100644 --- a/tools/testing/selftests/bpf/network_helpers.c +++ b/tools/testing/selftests/bpf/network_helpers.c @@ -120,12 +120,11 @@ error_close: return -1; } -static int start_server_proto(int family, int type, int protocol, - const char *addr_str, __u16 port, int timeout_ms) +int start_server(int family, int type, const char *addr_str, __u16 port, + int timeout_ms) { struct network_helper_opts opts = { .timeout_ms = timeout_ms, - .proto = protocol, }; struct sockaddr_storage addr; socklen_t addrlen; @@ -136,12 +135,6 @@ static int start_server_proto(int family, int type, int protocol, return __start_server(type, (struct sockaddr *)&addr, addrlen, false, &opts); } -int start_server(int family, int type, const char *addr_str, __u16 port, - int timeout_ms) -{ - return start_server_proto(family, type, 0, addr_str, port, timeout_ms); -} - int *start_reuseport_server(int family, int type, const char *addr_str, __u16 port, int timeout_ms, unsigned int nr_listens) { |