]> git.baikalelectronics.ru Git - kernel.git/commit
Add uid and cookie bpf helper to cg_skb_func_proto
authorChenbo Feng <fengc@google.com>
Sat, 15 Apr 2017 01:25:26 +0000 (18:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Apr 2017 19:22:00 +0000 (15:22 -0400)
commit1b5bb6fe2575e568cb8e101f9e5f965708a285f8
tree3afa94e99a832a2242bfda1bda997f0cd743abc7
parentaaa310e25f4bd573a42f432b2696b07b4b1711aa
Add uid and cookie bpf helper to cg_skb_func_proto

BPF helper functions get_socket_cookie and get_socket_uid can be
used for network traffic classifications, among others. Expose
them also to programs of type BPF_PROG_TYPE_CGROUP_SKB. As of
commit 034adad32b41 ("bpf: pass sk to helper functions") the
required skb->sk function is available at both cgroup bpf ingress
and egress hooks. With these two new helper, cg_skb_func_proto is
effectively the same as sk_filter_func_proto.

Change since V1:
Instead of add the helper to cg_skb_func_proto, redirect the
cg_skb_func_proto to sk_filter_func_proto since all helper function
in sk_filter_func_proto are applicable to cg_skb_func_proto now.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c