Skip to content

Commit

Permalink
selftests: Make sure all 'skel' variables are declared static
Browse files Browse the repository at this point in the history
If programs in prog_tests using skeletons declare the 'skel' variable as
global but not static, that will lead to linker errors on the final link of
the prog_tests binary due to duplicate symbols. Fix a few instances of this.

Fixes: b18c1f0 ("bpf: selftest: Adapt sock_fields test to use skel and global variables")
Fixes: 9a856ca ("bpf: selftest: Add test_btf_skc_cls_ingress")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200929123026.46751-1-toke@redhat.com
  • Loading branch information
Toke Høiland-Jørgensen authored and Alexei Starovoitov committed Sep 29, 2020
1 parent f1fc8ec commit f970cbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "test_progs.h"
#include "test_btf_skc_cls_ingress.skel.h"

struct test_btf_skc_cls_ingress *skel;
static struct test_btf_skc_cls_ingress *skel;
struct sockaddr_in6 srv_sa6;
static __u32 duration;

Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/prog_tests/sock_fields.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct bpf_spinlock_cnt {

static struct sockaddr_in6 srv_sa6, cli_sa6;
static int sk_pkt_out_cnt10_fd;
struct test_sock_fields *skel;
static struct test_sock_fields *skel;
static int sk_pkt_out_cnt_fd;
static __u64 parent_cg_id;
static __u64 child_cg_id;
Expand Down

0 comments on commit f970cbc

Please sign in to comment.