• A
    bpf: Add BPF_SOCK_OPS_TCP_LISTEN_CB · f333ee0c
    Andrey Ignatov 提交于
    Add new TCP-BPF callback that is called on listen(2) right after socket
    transition to TCP_LISTEN state.
    
    It fills the gap for listening sockets in TCP-BPF. For example BPF
    program can set BPF_SOCK_OPS_STATE_CB_FLAG when socket becomes listening
    and track later transition from TCP_LISTEN to TCP_CLOSE with
    BPF_SOCK_OPS_STATE_CB callback.
    
    Before there was no way to do it with TCP-BPF and other options were
    much harder to work with. E.g. socket state tracking can be done with
    tracepoints (either raw or regular) but they can't be attached to cgroup
    and their lifetime has to be managed separately.
    Signed-off-by: NAndrey Ignatov <rdna@fb.com>
    Acked-by: NAlexei Starovoitov <ast@kernel.org>
    Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
    f333ee0c
bpf.h 101.7 KB