]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Reject static maps
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 13 May 2021 23:36:43 +0000 (16:36 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 14 May 2021 00:23:58 +0000 (17:23 -0700)
commit3fddaf0136f3e94a6d3845fe59814e35011ee1f4
treea2146db56f08f2684dbefebc4989e66dc4507191
parenta63babd69722ac637d719adb226bf9cadd5f734a
libbpf: Reject static maps

Static maps never really worked with libbpf, because all such maps were always
silently resolved to the very first map. Detect static maps (both legacy and
BTF-defined) and report user-friendly error.

Tested locally by switching few maps (legacy and BTF-defined) in selftests to
static ones and verifying that now libbpf rejects them loudly.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210513233643.194711-2-andrii@kernel.org
tools/lib/bpf/libbpf.c