linux-stable/tools/lib
Andrii Nakryiko 87f92ac4c1 libbpf: Fix XDP program load regression for old kernels
Fix regression in libbpf, introduced by XDP link change, which causes XDP
programs to fail to be loaded into kernel due to specified BPF_XDP
expected_attach_type. While kernel doesn't enforce expected_attach_type for
BPF_PROG_TYPE_XDP, some old kernels already support XDP program, but they
don't yet recognize expected_attach_type field in bpf_attr, so setting it to
non-zero value causes program load to fail.

Luckily, libbpf already has a mechanism to deal with such cases, so just make
expected_attach_type optional for XDP programs.

Fixes: dc8698cac7 ("libbpf: Add support for BPF XDP link")
Reported-by: Nikita Shirokov <tehnerd@tehnerd.com>
Reported-by: Udip Pant <udippant@fb.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200924171705.3803628-1-andriin@fb.com
2020-09-24 10:33:02 -07:00
..
api libperf: Avoid counting of nonfilterable fdarray fds 2020-07-21 09:53:22 -03:00
bpf libbpf: Fix XDP program load regression for old kernels 2020-09-24 10:33:02 -07:00
lockdep .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf libperf: Fix man page typos 2020-08-13 09:34:26 -03:00
subcmd libsubcmd: Fix OPT_CALLBACK_SET() 2020-07-17 09:33:06 -03:00
symbol libsymbols kallsyms: Move hex2u64 out of header 2020-05-05 16:35:32 -03:00
traceevent libtraceevent: Fix build warning on 32-bit arches 2020-09-03 15:45:15 -03:00
argv_split.c
bitmap.c
ctype.c
find_bit.c
hweight.c
rbtree.c tools/: replace HTTP links with HTTPS ones 2020-08-07 11:33:21 -07:00
str_error_r.c
string.c tools lib: Fix builds when glibc contains strlcpy() 2020-01-06 11:46:10 -03:00
vsprintf.c
zalloc.c