diff options
author | Yonghong Song <yhs@fb.com> | 2020-06-24 01:08:15 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-06-25 03:37:59 +0200 |
commit | 0d4fad3e57df2bf61e8ffc8d12a34b1caf9b8835 (patch) | |
tree | a0e1c4d3842e4fcf68b2258de801de5e4a092d1c /kernel | |
parent | net: bpf: Implement bpf iterator for udp (diff) | |
download | linux-0d4fad3e57df2bf61e8ffc8d12a34b1caf9b8835.tar.xz linux-0d4fad3e57df2bf61e8ffc8d12a34b1caf9b8835.zip |
bpf: Add bpf_skc_to_udp6_sock() helper
The helper is used in tracing programs to cast a socket
pointer to a udp6_sock pointer.
The return value could be NULL if the casting is illegal.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Cc: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/bpf/20200623230815.3988481-1-yhs@fb.com
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/bpf_trace.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 48d935b0d87c..5d59dda5f661 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -1523,6 +1523,8 @@ tracing_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) return &bpf_skc_to_tcp_timewait_sock_proto; case BPF_FUNC_skc_to_tcp_request_sock: return &bpf_skc_to_tcp_request_sock_proto; + case BPF_FUNC_skc_to_udp6_sock: + return &bpf_skc_to_udp6_sock_proto; #endif case BPF_FUNC_seq_printf: return prog->expected_attach_type == BPF_TRACE_ITER ? |