Skip to content

Commit f52b8fd

Browse files
iamkafaianakryiko
authored andcommitted
bpf: selftest: Use static globals in tcp_hdr_options and btf_skc_cls_ingress
Some globals in the tcp_hdr_options test and btf_skc_cls_ingress test are not using static scope. This patch fixes it. Targeting bpf-next branch as an improvement since it currently does not break the build. Fixes: ad2f8eb ("bpf: selftests: Tcp header options") Fixes: 9a856ca ("bpf: selftest: Add test_btf_skc_cls_ingress") Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20201106225402.4135741-1-kafai@fb.com
1 parent 666475c commit f52b8fd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "test_btf_skc_cls_ingress.skel.h"
1818

1919
static struct test_btf_skc_cls_ingress *skel;
20-
struct sockaddr_in6 srv_sa6;
20+
static struct sockaddr_in6 srv_sa6;
2121
static __u32 duration;
2222

2323
#define PROG_PIN_FILE "/sys/fs/bpf/btf_skc_cls_ingress"

tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
#define LO_ADDR6 "::1"
1919
#define CG_NAME "/tcpbpf-hdr-opt-test"
2020

21-
struct bpf_test_option exp_passive_estab_in;
22-
struct bpf_test_option exp_active_estab_in;
23-
struct bpf_test_option exp_passive_fin_in;
24-
struct bpf_test_option exp_active_fin_in;
25-
struct hdr_stg exp_passive_hdr_stg;
26-
struct hdr_stg exp_active_hdr_stg = { .active = true, };
21+
static struct bpf_test_option exp_passive_estab_in;
22+
static struct bpf_test_option exp_active_estab_in;
23+
static struct bpf_test_option exp_passive_fin_in;
24+
static struct bpf_test_option exp_active_fin_in;
25+
static struct hdr_stg exp_passive_hdr_stg;
26+
static struct hdr_stg exp_active_hdr_stg = { .active = true, };
2727

2828
static struct test_misc_tcp_hdr_options *misc_skel;
2929
static struct test_tcp_hdr_options *skel;

0 commit comments

Comments
 (0)