diff options
author | Stanislav Fomichev <sdf@google.com> | 2020-07-07 02:01:25 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-07-08 02:03:31 +0300 |
commit | f5836749c9c04a10decd2742845ad4870965fdef (patch) | |
tree | 44335764c2ebba2099ba8bf26267bdfac7c36ed1 /tools/lib/bpf | |
parent | 4e48978cd28ce51945c08650e5c5502ca41e1fcc (diff) | |
download | linux-f5836749c9c04a10decd2742845ad4870965fdef.tar.xz |
bpf: Add BPF_CGROUP_INET_SOCK_RELEASE hook
Sometimes it's handy to know when the socket gets freed. In
particular, we'd like to try to use a smarter allocation of
ports for bpf_bind and explore the possibility of limiting
the number of SOCK_DGRAM sockets the process can have.
Implement BPF_CGROUP_INET_SOCK_RELEASE hook that triggers on
inet socket release. It triggers only for userspace sockets
(not in-kernel ones) and therefore has the same semantics as
the existing BPF_CGROUP_INET_SOCK_CREATE.
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200706230128.4073544-2-sdf@google.com
Diffstat (limited to 'tools/lib/bpf')
0 files changed, 0 insertions, 0 deletions