Skip to content

Commit 06d3e4c

Browse files
rdnaAlexei Starovoitov
authored andcommitted
bpf: Allow skb_ancestor_cgroup_id helper in cgroup skb
cgroup skb programs already can use bpf_skb_cgroup_id. Allow bpf_skb_ancestor_cgroup_id as well so that container policies can be implemented for a container that can have sub-cgroups dynamically created, but policies should still be implemented based on cgroup id of container itself not on an id of a sub-cgroup. Signed-off-by: Andrey Ignatov <rdna@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/8874194d6041eba190356453ea9f6071edf5f658.1589486450.git.rdna@fb.com
1 parent d56c2f9 commit 06d3e4c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/core/filter.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6157,6 +6157,8 @@ cg_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
61576157
#ifdef CONFIG_SOCK_CGROUP_DATA
61586158
case BPF_FUNC_skb_cgroup_id:
61596159
return &bpf_skb_cgroup_id_proto;
6160+
case BPF_FUNC_skb_ancestor_cgroup_id:
6161+
return &bpf_skb_ancestor_cgroup_id_proto;
61606162
#endif
61616163
#ifdef CONFIG_INET
61626164
case BPF_FUNC_sk_lookup_tcp:

0 commit comments

Comments
 (0)