diff options
author | Stanislav Fomichev | 2021-05-14 10:05:28 -0700 |
---|---|---|
committer | Daniel Borkmann | 2021-05-20 23:48:37 +0200 |
commit | 8f1634b82189e715b0f82f16ce54fab43cfedd8a (patch) | |
tree | b06f34cd9ec54455c8dde7818323d6e9a11dc717 /tools | |
parent | 6bdacdb48e94ff26c03c6eeeef48c03c5e2f7dd4 (diff) |
selftests/bpf: Convert static to global in tc_redirect progs
Both IFINDEX_SRC and IFINDEX_DST are set from the userspace
and it won't work once bpf merges with bpf-next.
Fixes: 096eccdef0b3 ("selftests/bpf: Rewrite test_tc_redirect.sh as prog_tests/tc_redirect.c")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210514170528.3750250-1-sdf@google.com
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_tc_neigh.c | 4 | ||||
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_tc_peer.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_tc_neigh.c b/tools/testing/selftests/bpf/progs/test_tc_neigh.c index 90f64a85998f..0c93d326a663 100644 --- a/tools/testing/selftests/bpf/progs/test_tc_neigh.c +++ b/tools/testing/selftests/bpf/progs/test_tc_neigh.c @@ -33,8 +33,8 @@ a.s6_addr32[3] == b.s6_addr32[3]) #endif -static volatile const __u32 IFINDEX_SRC; -static volatile const __u32 IFINDEX_DST; +volatile const __u32 IFINDEX_SRC; +volatile const __u32 IFINDEX_DST; static __always_inline bool is_remote_ep_v4(struct __sk_buff *skb, __be32 addr) diff --git a/tools/testing/selftests/bpf/progs/test_tc_peer.c b/tools/testing/selftests/bpf/progs/test_tc_peer.c index 72c72950c3bb..ef264bced0e6 100644 --- a/tools/testing/selftests/bpf/progs/test_tc_peer.c +++ b/tools/testing/selftests/bpf/progs/test_tc_peer.c @@ -8,8 +8,8 @@ #include <bpf/bpf_helpers.h> -static volatile const __u32 IFINDEX_SRC; -static volatile const __u32 IFINDEX_DST; +volatile const __u32 IFINDEX_SRC; +volatile const __u32 IFINDEX_DST; SEC("classifier/chk_egress") int tc_chk(struct __sk_buff *skb) |