selftests/bpf: Initialize tc in xdp_synproxy
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 2 Feb 2023 23:53:35 +0000 (00:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:58 +0000 (09:32 +0100)
commitd0105ef2f05e22dddacfd675e359cdd350a667c3
treec1fb417fdbd8faed814803fbc7cc6d13cc571939
parent71c83b54be42dcb0c46ca00e2dc2dddfc4e56f69
selftests/bpf: Initialize tc in xdp_synproxy

[ Upstream commit 354bb4a0e0b6be8f55bacbe7f08c94b4741f5658 ]

xdp_synproxy/xdp fails in CI with:

    Error: bpf_tc_hook_create: File exists

The XDP version of the test should not be calling bpf_tc_hook_create();
the reason it's happening anyway is that if we don't specify --tc on the
command line, tc variable remains uninitialized.

Fixes: 784d5dc0efc2 ("selftests/bpf: Add selftests for raw syncookie helpers in TC mode")
Reported-by: Alexei Starovoitov <ast@kernel.org>
Reported-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20230202235335.3403781-1-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/xdp_synproxy.c