aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2019-06-27 18:12:33 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-06-29 01:21:53 +0200
commit2d6dbb9a65f4001f2878512078394c11301994f3 (patch)
treeb87a2a5edec8319f2bffcee34ef541e07d17345f /include/linux
parentMerge branch 'bpf-sockopt-hooks' (diff)
downloadlinux-dev-2d6dbb9a65f4001f2878512078394c11301994f3.tar.xz
linux-dev-2d6dbb9a65f4001f2878512078394c11301994f3.zip
selftests/bpf: fix -Wstrict-aliasing in test_sockopt_sk.c
Let's use union with u8[4] and u32 members for sockopt buffer, that should fix any possible aliasing issues. test_sockopt_sk.c: In function ‘getsetsockopt’: test_sockopt_sk.c:115:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (*(__u32 *)buf != 0x55AA*2) { ^~ test_sockopt_sk.c:116:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] log_err("Unexpected getsockopt(SO_SNDBUF) 0x%x != 0x55AA*2", ^~~~~~~ Fixes: 8a027dc0d8f5 ("selftests/bpf: add sockopt test that exercises sk helpers") Reported-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Stanislav Fomichev <sdf@google.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions