Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: Make sure all 'skel' variables are declared static

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: b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables")
Fixes: 9a856cae2217 ("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

authored by

Toke Høiland-Jørgensen and committed by
Alexei Starovoitov
f970cbcd f1fc8ece

+2 -2
+1 -1
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c
··· 16 16 #include "test_progs.h" 17 17 #include "test_btf_skc_cls_ingress.skel.h" 18 18 19 - struct test_btf_skc_cls_ingress *skel; 19 + static struct test_btf_skc_cls_ingress *skel; 20 20 struct sockaddr_in6 srv_sa6; 21 21 static __u32 duration; 22 22
+1 -1
tools/testing/selftests/bpf/prog_tests/sock_fields.c
··· 36 36 37 37 static struct sockaddr_in6 srv_sa6, cli_sa6; 38 38 static int sk_pkt_out_cnt10_fd; 39 - struct test_sock_fields *skel; 39 + static struct test_sock_fields *skel; 40 40 static int sk_pkt_out_cnt_fd; 41 41 static __u64 parent_cg_id; 42 42 static __u64 child_cg_id;