diff options
| author | Jakub Sitnicki <[email protected]> | 2019-12-12 10:22:50 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2019-12-13 20:38:00 +0000 |
| commit | 67d69ccdf389f3b7fabb00e2d81473a915b3b64d (patch) | |
| tree | 65332edc16f817e021a858ae12b5015259a9c52c /tools/lib/bpf/libbpf.c | |
| parent | libbpf: Fix printf compilation warnings on ppc64le arch (diff) | |
| download | kernel-67d69ccdf389f3b7fabb00e2d81473a915b3b64d.tar.gz kernel-67d69ccdf389f3b7fabb00e2d81473a915b3b64d.zip | |
libbpf: Recognize SK_REUSEPORT programs from section name
Allow loading BPF object files that contain SK_REUSEPORT programs without
having to manually set the program type before load if the the section name
is set to "sk_reuseport".
Makes user-space code needed to load SK_REUSEPORT BPF program more concise.
Signed-off-by: Jakub Sitnicki <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 920d4e06a5f9..b99c0a9b7756 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -4983,6 +4983,7 @@ static const struct { enum bpf_attach_type attach_type; } section_names[] = { BPF_PROG_SEC("socket", BPF_PROG_TYPE_SOCKET_FILTER), + BPF_PROG_SEC("sk_reuseport", BPF_PROG_TYPE_SK_REUSEPORT), BPF_PROG_SEC("kprobe/", BPF_PROG_TYPE_KPROBE), BPF_PROG_SEC("uprobe/", BPF_PROG_TYPE_KPROBE), BPF_PROG_SEC("kretprobe/", BPF_PROG_TYPE_KPROBE), |
