diff options
author | Martin KaFai Lau <martin.lau@kernel.org> | 2022-11-28 23:08:54 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-11-30 22:47:42 +0100 |
commit | 052c82dcdcbb6eb89d0967c309c010cd293076d0 (patch) | |
tree | 23fb7c74c389e6a8ecaaf97b4b147016d4a73099 /tools/edid | |
parent | 91a7de85600d5dfa272cea3cef83052e067dc0ab (diff) | |
download | linux-052c82dcdcbb6eb89d0967c309c010cd293076d0.tar.bz2 |
selftests/bpf: Use if_nametoindex instead of reading the /sys/net/class/*/ifindex
When switching netns, the setns_by_fd() is doing dances in mount/umounting
the /sys directories. One reason is the tc_redirect.c test is depending
on the /sys/net/class/*/ifindex instead of using the if_nametoindex().
if_nametoindex() uses ioctl() to get the ifindex.
This patch is to move all /sys/net/class/*/ifindex usages to
if_nametoindex(). The current code checks ifindex >= 0 which is
incorrect. ifindex > 0 should be checked instead. This patch also
stores ifindex_veth_src and ifindex_veth_dst since the latter patch
will need them.
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/bpf/20221129070900.3142427-2-martin.lau@linux.dev
Diffstat (limited to 'tools/edid')
0 files changed, 0 insertions, 0 deletions