diff options
author | Cong Wang <cong.wang@bytedance.com> | 2021-03-30 19:32:30 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-04-01 10:56:14 -0700 |
commit | a7ba4558e69a3c2ae4ca521f015832ef44799538 (patch) | |
tree | de4e53cf984dcbd68b485660ae96431fa7402e22 /kernel/bpf | |
parent | b017055255d620b365299c3824610e0098414664 (diff) | |
download | linux-stable-a7ba4558e69a3c2ae4ca521f015832ef44799538.tar.gz linux-stable-a7ba4558e69a3c2ae4ca521f015832ef44799538.tar.bz2 linux-stable-a7ba4558e69a3c2ae4ca521f015832ef44799538.zip |
sock_map: Introduce BPF_SK_SKB_VERDICT
Reusing BPF_SK_SKB_STREAM_VERDICT is possible but its name is
confusing and more importantly we still want to distinguish them
from user-space. So we can just reuse the stream verdict code but
introduce a new type of eBPF program, skb_verdict. Users are not
allowed to attach stream_verdict and skb_verdict programs to the
same map.
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210331023237.41094-10-xiyou.wangcong@gmail.com
Diffstat (limited to 'kernel/bpf')
-rw-r--r-- | kernel/bpf/syscall.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 9603de81811a..6428634da57e 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -2948,6 +2948,7 @@ attach_type_to_prog_type(enum bpf_attach_type attach_type) return BPF_PROG_TYPE_SK_MSG; case BPF_SK_SKB_STREAM_PARSER: case BPF_SK_SKB_STREAM_VERDICT: + case BPF_SK_SKB_VERDICT: return BPF_PROG_TYPE_SK_SKB; case BPF_LIRC_MODE2: return BPF_PROG_TYPE_LIRC_MODE2; |