Skip to content

Commit 121bee2

Browse files
mdaverdeNobody
authored andcommitted
bpf/bpftool: handle libbpf_probe_prog_type errors
Previously [1], we were using bpf_probe_prog_type which returned a bool, but the new libbpf_probe_bpf_prog_type can return a negative error code on failure. This change decides for bpftool to declare a program type is not available on probe failure. [1] https://lore.kernel.org/bpf/[email protected]/ Signed-off-by: Milan Landaverde <[email protected]>
1 parent c4042a2 commit 121bee2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/bpf/bpftool/feature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ probe_prog_type(enum bpf_prog_type prog_type, bool *supported_types,
567567

568568
res = probe_prog_type_ifindex(prog_type, ifindex);
569569
} else {
570-
res = libbpf_probe_bpf_prog_type(prog_type, NULL);
570+
res = libbpf_probe_bpf_prog_type(prog_type, NULL) > 0;
571571
}
572572

573573
#ifdef USE_LIBCAP

0 commit comments

Comments
 (0)