bpf, selftests: Extend test_tc_redirect to use modified bpf_redirect_neigh()
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 20 Oct 2020 21:25:57 +0000 (23:25 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 21 Oct 2020 23:30:00 +0000 (01:30 +0200)
commitadfd272c4ccbe43d9761bb17dd8a4387d7815382
tree10b89471c15288c7b3402937670ec95270ddf092
parentba452c9e996d8a4c347b32805f91abb70de5de7e
bpf, selftests: Extend test_tc_redirect to use modified bpf_redirect_neigh()

This updates the test_tc_neigh prog in selftests to use the new syntax of
bpf_redirect_neigh(). To exercise the helper both with and without the
optional parameter, add an additional test_tc_neigh_fib test program, which
does a bpf_fib_lookup() followed by a call to bpf_redirect_neigh() instead
of looking up the ifindex in a map.

Update the test_tc_redirect.sh script to run both versions of the test,
and while we're add it, fix it to work on systems that have a consolidated
dual-stack 'ping' binary instead of separate ping/ping6 versions.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/160322915724.32199.17530068594636950447.stgit@toke.dk
tools/testing/selftests/bpf/progs/test_tc_neigh.c
tools/testing/selftests/bpf/progs/test_tc_neigh_fib.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_tc_redirect.sh