1 // SPDX-License-Identifier: GPL-2.0
4 #include <bpf/bpf_tracing.h>
5 #include <bpf/bpf_helpers.h>
9 char _license[] SEC("license") = "GPL";
11 int bpf_sock_destroy(struct sock_common *sk) __ksym;
13 SEC("tp_btf/tcp_destroy_sock")
14 __failure __msg("calling kernel function bpf_sock_destroy is not allowed")
15 int BPF_PROG(trace_tcp_destroy_sock, struct sock *sk)
18 bpf_sock_destroy((struct sock_common *)sk);