selftests/bpf: Make test_varlen work with 32-bit user-space arch
Despite bpftool generating data section memory layout that will work for 32-bit architectures on user-space side, BPF programs should be careful to not use ambiguous types like `long`, which have different size in 32-bit and 64-bit environments. Fix that in test by using __u64 explicitly, which is a recommended approach anyway. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200813204945.1020225-10-andriin@fb.com
This commit is contained in:

zatwierdzone przez
Alexei Starovoitov

rodzic
0f993845d7
commit
4fccd2ff74
@@ -15,9 +15,9 @@ int test_pid = 0;
|
||||
bool capture = false;
|
||||
|
||||
/* .bss */
|
||||
long payload1_len1 = 0;
|
||||
long payload1_len2 = 0;
|
||||
long total1 = 0;
|
||||
__u64 payload1_len1 = 0;
|
||||
__u64 payload1_len2 = 0;
|
||||
__u64 total1 = 0;
|
||||
char payload1[MAX_LEN + MAX_LEN] = {};
|
||||
|
||||
/* .data */
|
||||
|
Reference in New Issue
Block a user