Skip to content

Commit 1b0ad43

Browse files
mmhalborkmann
authored andcommitted
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: 75e0e27 ("selftest/bpf: Change udp to inet in some function names") Suggested-by: Jakub Sitnicki <[email protected]> Signed-off-by: Michal Luczaj <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Tested-by: Jakub Sitnicki <[email protected]> Reviewed-by: Jakub Sitnicki <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 638f326 commit 1b0ad43

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/testing/selftests/bpf/prog_tests/sockmap_listen.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ static void unix_inet_redir_to_connected(int family, int type,
18281828
if (err)
18291829
return;
18301830

1831-
if (socketpair(AF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK, 0, sfd))
1831+
if (socketpair(AF_UNIX, type | SOCK_NONBLOCK, 0, sfd))
18321832
goto close_cli0;
18331833
c1 = sfd[0], p1 = sfd[1];
18341834

@@ -1840,7 +1840,6 @@ static void unix_inet_redir_to_connected(int family, int type,
18401840
close_cli0:
18411841
xclose(c0);
18421842
xclose(p0);
1843-
18441843
}
18451844

18461845
static void unix_inet_skb_redir_to_connected(struct test_sockmap_listen *skel,

0 commit comments

Comments
 (0)