Skip to content

Commit

Permalink
selftests/bpf: Convert static to global in tc_redirect progs
Browse files Browse the repository at this point in the history
Both IFINDEX_SRC and IFINDEX_DST are set from the userspace
and it won't work once bpf merges with bpf-next.

Fixes: 096eccd ("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
  • Loading branch information
Stanislav Fomichev authored and Daniel Borkmann committed May 20, 2021
1 parent 6bdacdb commit 8f1634b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/progs/test_tc_neigh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/progs/test_tc_peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8f1634b

Please sign in to comment.