]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Fix bpftool build by switching to bpf_object__open_file()
authorAndrii Nakryiko <andriin@fb.com>
Mon, 7 Oct 2019 22:56:04 +0000 (15:56 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 8 Oct 2019 01:44:28 +0000 (18:44 -0700)
commitc29b87867eae97f09a4a7eb9f63745a0e0c6c98f
treede31cc9080a1766f1fb5db447028ada51ea5cedd
parent8f463d7e3cb199769baf79ef50d00674bf65ca5c
bpftool: Fix bpftool build by switching to bpf_object__open_file()

As part of libbpf in 00af32571725 ("libbpf: stop enforcing kern_version,
populate it for users") non-LIBBPF_API __bpf_object__open_xattr() API
was removed from libbpf.h header. This broke bpftool, which relied on
that function. This patch fixes the build by switching to newly added
bpf_object__open_file() which provides the same capabilities, but is
official and future-proof API.

v1->v2:
- fix prog_type shadowing (Stanislav).

Fixes: 00af32571725 ("libbpf: stop enforcing kern_version, populate it for users")
Reported-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/bpf/20191007225604.2006146-1-andriin@fb.com
tools/bpf/bpftool/main.c
tools/bpf/bpftool/main.h
tools/bpf/bpftool/prog.c