summaryrefslogtreecommitdiff
path: root/include/linux/sock_diag.h
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2020-09-30 18:18:15 +0300
committerAlexei Starovoitov <ast@kernel.org>2020-09-30 21:50:34 +0300
commitb426ce83baa7dff947fb354118d3133f2953aac8 (patch)
tree7d64f878329748f97202001f7b9a53f0a43f234c /include/linux/sock_diag.h
parent963ec27a10fa6dc700c0465e95965c0bf696a606 (diff)
downloadlinux-b426ce83baa7dff947fb354118d3133f2953aac8.tar.xz
bpf: Add classid helper only based on skb->sk
Similarly to 5a52ae4e32a6 ("bpf: Allow to retrieve cgroup v1 classid from v2 hooks"), add a helper to retrieve cgroup v1 classid solely based on the skb->sk, so it can be used as key as part of BPF map lookups out of tc from host ns, in particular given the skb->sk is retained these days when crossing net ns thanks to 9c4c325252c5 ("skbuff: preserve sock reference when scrubbing the skb."). This is similar to bpf_skb_cgroup_id() which implements the same for v2. Kubernetes ecosystem is still operating on v1 however, hence net_cls needs to be used there until this can be dropped in with the v2 helper of bpf_skb_cgroup_id(). Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/ed633cf27a1c620e901c5aa99ebdefb028dce600.1601477936.git.daniel@iogearbox.net
Diffstat (limited to 'include/linux/sock_diag.h')
0 files changed, 0 insertions, 0 deletions