]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: libbpf: retry map creation without the name
authorStanislav Fomichev <sdf@google.com>
Mon, 19 Nov 2018 22:49:01 +0000 (14:49 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 19 Nov 2018 23:49:32 +0000 (00:49 +0100)
commit4ab82f01e58709ec22848e3e94d5eaea2220e1d6
tree6bfd2e191914a24c538ed5d6b850cf05bd4dd836
parent1261b6c35b9e0943522bb4e467426f58b7f3e576
bpf: libbpf: retry map creation without the name

Since commit 5793510d98f0 ("bpf: libbpf: Provide basic API support
to specify BPF obj name"), libbpf unconditionally sets bpf_attr->name
for maps. Pre v4.14 kernels don't know about map names and return an
error about unexpected non-zero data. Retry sys_bpf without a map
name to cover older kernels.

v2 changes:
* check for errno == EINVAL as suggested by Daniel Borkmann

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/bpf.c