Skip to content

Commit 51f1958

Browse files
rgo3gregkh
authored andcommitted
libbpf: Fix probe for BPF_PROG_TYPE_CGROUP_SOCKOPT
[ Upstream commit 78d14bd ] This patch fixes the probe for BPF_PROG_TYPE_CGROUP_SOCKOPT, so the probe reports accurate results when used by e.g. bpftool. Fixes: 4cdbfb5 ("libbpf: support sockopt hooks") Signed-off-by: Robin Gögge <r.goegge@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20210728225825.2357586-1-r.goegge@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 466f550 commit 51f1958

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tools/lib/bpf/libbpf_probes.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ probe_load(enum bpf_prog_type prog_type, const struct bpf_insn *insns,
7575
case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
7676
xattr.expected_attach_type = BPF_CGROUP_INET4_CONNECT;
7777
break;
78+
case BPF_PROG_TYPE_CGROUP_SOCKOPT:
79+
xattr.expected_attach_type = BPF_CGROUP_GETSOCKOPT;
80+
break;
7881
case BPF_PROG_TYPE_SK_LOOKUP:
7982
xattr.expected_attach_type = BPF_SK_LOOKUP;
8083
break;
@@ -104,7 +107,6 @@ probe_load(enum bpf_prog_type prog_type, const struct bpf_insn *insns,
104107
case BPF_PROG_TYPE_SK_REUSEPORT:
105108
case BPF_PROG_TYPE_FLOW_DISSECTOR:
106109
case BPF_PROG_TYPE_CGROUP_SYSCTL:
107-
case BPF_PROG_TYPE_CGROUP_SOCKOPT:
108110
case BPF_PROG_TYPE_TRACING:
109111
case BPF_PROG_TYPE_STRUCT_OPS:
110112
case BPF_PROG_TYPE_EXT:

0 commit comments

Comments
 (0)