Skip to content

Commit b407b52

Browse files
ThinkerYzu1Martin KaFai Lau
authored andcommitted
selftests/bpf: Monitor traffic for sockmap_listen.
Enable traffic monitor for each subtest of sockmap_listen. Acked-by: Stanislav Fomichev <[email protected]> Signed-off-by: Kui-Feng Lee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
1 parent 52a5b8a commit b407b52

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,15 +1925,23 @@ static void test_udp_unix_redir(struct test_sockmap_listen *skel, struct bpf_map
19251925
int family)
19261926
{
19271927
const char *family_name, *map_name;
1928+
struct netns_obj *netns;
19281929
char s[MAX_TEST_NAME];
19291930

19301931
family_name = family_str(family);
19311932
map_name = map_type_str(map);
19321933
snprintf(s, sizeof(s), "%s %s %s", map_name, family_name, __func__);
19331934
if (!test__start_subtest(s))
19341935
return;
1936+
1937+
netns = netns_new("sockmap_listen", true);
1938+
if (!ASSERT_OK_PTR(netns, "netns_new"))
1939+
return;
1940+
19351941
inet_unix_skb_redir_to_connected(skel, map, family);
19361942
unix_inet_skb_redir_to_connected(skel, map, family);
1943+
1944+
netns_free(netns);
19371945
}
19381946

19391947
static void run_tests(struct test_sockmap_listen *skel, struct bpf_map *map,

0 commit comments

Comments
 (0)