提交 5b32a23e 编写于 作者: S Stanislav Fomichev 提交者: Daniel Borkmann

bpf: libbpf: don't specify prog name if kernel doesn't support it

Use recently added capability check.

See commit 23499442 ("bpf: libbpf: retry map creation without
the name") for rationale.
Signed-off-by: NStanislav Fomichev <sdf@google.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
上级 94cb310c
......@@ -1439,7 +1439,8 @@ load_program(struct bpf_program *prog, struct bpf_insn *insns, int insns_cnt,
memset(&load_attr, 0, sizeof(struct bpf_load_program_attr));
load_attr.prog_type = prog->type;
load_attr.expected_attach_type = prog->expected_attach_type;
load_attr.name = prog->name;
if (prog->caps->name)
load_attr.name = prog->name;
load_attr.insns = insns;
load_attr.insns_cnt = insns_cnt;
load_attr.license = license;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册