]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: fix check for presence of associated BTF for map creation
authorAndrii Nakryiko <andriin@fb.com>
Thu, 13 Jun 2019 05:04:57 +0000 (22:04 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 14 Jun 2019 23:14:08 +0000 (01:14 +0200)
commit412e53bfadfe7ab31bad2df7b484ae1b8be4e799
tree06cd75e0a0bade9f0d12da0504d50adb1abc9f07
parent6c899123ceb138dbc57321eaeecac3ea1f566b9b
libbpf: fix check for presence of associated BTF for map creation

Kernel internally checks that either key or value type ID is specified,
before using btf_fd. Do the same in libbpf's map creation code for
determining when to retry map creation w/o BTF.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: f489a48ed597 ("libbpf: use negative fd to specify missing BTF")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c