Thread (2 messages) 2 messages, 2 authors, 2021-12-29

Re: [PATCH net-next] net: bpf: hook for inet port bind conflict check

From: Alexei Starovoitov <hidden>
Date: 2021-12-29 16:44:23
Also in: bpf, lkml

On Wed, Dec 29, 2021 at 12:56 AM [off-list ref] wrote:
From: Menglong Dong <redacted>

This hook of cgroup is called while TCP/UDP local port bind conflict
check. This is different from the 'commit aac3fc320d94 ("bpf: Post-hooks
for sys_bind")', as it is also called in autobind case.

For TCP, this hook is called during sys_bind() and autobind. And it
is also called during tcp_v4_connect() before hash the sock to ehash,
during which src ip, src port, dst ip, and dst port is already
allocated, means that we have a chance to determine whether this
connect should continue.

This can be useful when we want some applications not to use some
port (include auto bind port). For autobind, the kernel has the chance
to choose another port.
The use case is too vague to consider adding a new hook.
Also there are no selftests.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help