diff options
| author | Mahe Tardy <mahe.tardy@gmail.com> | 2025-02-25 15:50:30 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-02-26 18:35:51 +0300 |
| commit | c221d3744ad38a9655aba8235e1d783c6d4aed5a (patch) | |
| tree | 64d71dee724a70f417f0eb24e1eb8ec80a1d3722 | |
| parent | 4e4136c6446753e6da4424a734f84de82c70600f (diff) | |
| download | linux-c221d3744ad38a9655aba8235e1d783c6d4aed5a.tar.xz | |
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 <mahe.tardy@gmail.com>
Link: https://lore.kernel.org/r/20250225125031.258740-1-mahe.tardy@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
| -rw-r--r-- | net/core/filter.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 2ec162dd83c4..827108c6dad9 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -8075,6 +8075,8 @@ sk_filter_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) return &bpf_skb_load_bytes_relative_proto; case BPF_FUNC_get_socket_cookie: return &bpf_get_socket_cookie_proto; + case BPF_FUNC_get_netns_cookie: + return &bpf_get_netns_cookie_proto; case BPF_FUNC_get_socket_uid: return &bpf_get_socket_uid_proto; case BPF_FUNC_perf_event_output: |
