selftests/bpf: fix "ctx:write sysctl:write read ok" on s390
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 30 Aug 2019 11:07:30 +0000 (13:07 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 3 Sep 2019 19:01:52 +0000 (21:01 +0200)
commit3404ddf234ba4677bf224cb15ddcdea0ceab956e
tree7dde5f4430846f68a01a48440d0e63f9ae56fa3f
parentb9632679944307f3caab183fa69a4d79ffeb40ce
selftests/bpf: fix "ctx:write sysctl:write read ok" on s390

"ctx:write sysctl:write read ok" fails on s390 because it reads the
first byte of an int assuming it's the least-significant one, which
is not the case on big-endian arches. Since we are not testing narrow
accesses here (there is e.g. "ctx:file_pos sysctl:read read ok narrow"
for that), simply read the whole int.

Fixes: 1f5fa9ab6e2e ("selftests/bpf: Test BPF_CGROUP_SYSCTL")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_sysctl.c