summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorMichal Luczaj <mhal@rbox.co>2024-07-13 22:41:39 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2024-07-17 23:51:45 +0300
commit1b0ad43177c097d38b967b99c2b71d8be28b0223 (patch)
treed761807f5083c5ee76e7ade2d22fc81d146d8b0f /tools/testing/selftests/bpf/prog_tests
parent638f32604385fd23059985da8de918e9c18f0b98 (diff)
downloadlinux-1b0ad43177c097d38b967b99c2b71d8be28b0223.tar.xz
selftests/bpf: Support SOCK_STREAM in unix_inet_redir_to_connected()
Function ignores the AF_UNIX socket type argument, SOCK_DGRAM is hardcoded. Fix to respect the argument provided. Fixes: 75e0e27db6cf ("selftest/bpf: Change udp to inet in some function names") Suggested-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: Michal Luczaj <mhal@rbox.co> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Jakub Sitnicki <jakub@cloudflare.com> Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com> Link: https://lore.kernel.org/bpf/20240713200218.2140950-3-mhal@rbox.co
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/sockmap_listen.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
index e91b59366030..c075d376fcab 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
@@ -1828,7 +1828,7 @@ static void unix_inet_redir_to_connected(int family, int type,
if (err)
return;
- if (socketpair(AF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK, 0, sfd))
+ if (socketpair(AF_UNIX, type | SOCK_NONBLOCK, 0, sfd))
goto close_cli0;
c1 = sfd[0], p1 = sfd[1];
@@ -1840,7 +1840,6 @@ static void unix_inet_redir_to_connected(int family, int type,
close_cli0:
xclose(c0);
xclose(p0);
-
}
static void unix_inet_skb_redir_to_connected(struct test_sockmap_listen *skel,