diff options
| author | Daniel Borkmann <[email protected]> | 2015-07-15 12:21:42 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2015-07-20 19:41:30 +0000 |
| commit | 8d20aabe1c76cccac544d9fcc3ad7823d9e98a2d (patch) | |
| tree | be182dc2e3829040518d72c41363ffec458f1245 /net/switchdev/switchdev.c | |
| parent | cls_cgroup: factor out classid retrieval (diff) | |
| download | kernel-8d20aabe1c76cccac544d9fcc3ad7823d9e98a2d.tar.gz kernel-8d20aabe1c76cccac544d9fcc3ad7823d9e98a2d.zip | |
ebpf: add helper to retrieve net_cls's classid cookie
It would be very useful to retrieve the net_cls's classid from an eBPF
program to allow for a more fine-grained classification, it could be
directly used or in conjunction with additional policies. I.e. docker,
but also tooling such as cgexec, can easily run applications via net_cls
cgroups:
cgcreate -g net_cls:/foo
echo 42 > foo/net_cls.classid
cgexec -g net_cls:foo <prog>
Thus, their respecitve classid cookie of foo can then be looked up on
the egress path to apply further policies. The helper is desigend such
that a non-zero value returns the cgroup id.
Signed-off-by: Daniel Borkmann <[email protected]>
Cc: Thomas Graf <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions
