Skip to content
Commit e6b88584 authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Greg Kroah-Hartman
Browse files

libbpf: Fix endianness detection in BPF_CORE_READ_BITFIELD_PROBED()



[ Upstream commit 45f2bebc ]

__BYTE_ORDER is supposed to be defined by a libc, and __BYTE_ORDER__ -
by a compiler. bpf_core_read.h checks __BYTE_ORDER == __LITTLE_ENDIAN,
which is true if neither are defined, leading to incorrect behavior on
big-endian hosts if libc headers are not included, which is often the
case.

Fixes: ee26dade ("libbpf: Add support for relocatable bitfields")
Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211026010831.748682-2-iii@linux.ibm.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a003933e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment