Skip to content

Commit b3b15b7

Browse files
mmhalMartin KaFai Lau
authored andcommitted
selftests/bpf: Honour the sotype of af_unix redir tests
Do actually test the sotype as specified by the caller. This picks up after commit 75e0e27 ("selftest/bpf: Change udp to inet in some function names"). Reviewed-by: Jakub Sitnicki <[email protected]> Tested-by: Jakub Sitnicki <[email protected]> Suggested-by: Jakub Sitnicki <[email protected]> Signed-off-by: Michal Luczaj <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
1 parent 4e3dec2 commit b3b15b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,11 +1706,11 @@ static void inet_unix_redir_to_connected(int family, int type, int sock_mapfd,
17061706
int sfd[2];
17071707
int err;
17081708

1709-
if (socketpair(AF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK, 0, sfd))
1709+
if (socketpair(AF_UNIX, type | SOCK_NONBLOCK, 0, sfd))
17101710
return;
17111711
c0 = sfd[0], p0 = sfd[1];
17121712

1713-
err = inet_socketpair(family, SOCK_DGRAM, &p1, &c1);
1713+
err = inet_socketpair(family, type, &p1, &c1);
17141714
if (err)
17151715
goto close;
17161716

@@ -1758,7 +1758,7 @@ static void unix_inet_redir_to_connected(int family, int type, int sock_mapfd,
17581758
int sfd[2];
17591759
int err;
17601760

1761-
err = inet_socketpair(family, SOCK_DGRAM, &p0, &c0);
1761+
err = inet_socketpair(family, type, &p0, &c0);
17621762
if (err)
17631763
return;
17641764

0 commit comments

Comments
 (0)