Skip to content

Commit c221d37

Browse files
mtardyAlexei Starovoitov
authored andcommitted
bpf: add get_netns_cookie helper to cgroup_skb programs
This is needed in the context of Cilium and Tetragon to retrieve netns cookie from hostns when traffic leaves Pod, so that we can correlate skb->sk's netns cookie. Signed-off-by: Mahe Tardy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 4e4136c commit c221d37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/core/filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8075,6 +8075,8 @@ sk_filter_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
80758075
return &bpf_skb_load_bytes_relative_proto;
80768076
case BPF_FUNC_get_socket_cookie:
80778077
return &bpf_get_socket_cookie_proto;
8078+
case BPF_FUNC_get_netns_cookie:
8079+
return &bpf_get_netns_cookie_proto;
80788080
case BPF_FUNC_get_socket_uid:
80798081
return &bpf_get_socket_uid_proto;
80808082
case BPF_FUNC_perf_event_output:

0 commit comments

Comments
 (0)