af_unix: Implement ->psock_update_sk_prot()
Now we can implement unix_bpf_update_proto() to update sk_prot, especially prot->close(). Signed-off-by: Cong Wang <cong.wang@bytedance.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210704190252.11866-7-xiyou.wangcong@gmail.com
This commit is contained in:
committed by
Alexei Starovoitov
parent
c7272e15f0
commit
c63829182c
@@ -788,11 +788,14 @@ static void unix_close(struct sock *sk, long timeout)
|
||||
*/
|
||||
}
|
||||
|
||||
static struct proto unix_proto = {
|
||||
struct proto unix_proto = {
|
||||
.name = "UNIX",
|
||||
.owner = THIS_MODULE,
|
||||
.obj_size = sizeof(struct unix_sock),
|
||||
.close = unix_close,
|
||||
#ifdef CONFIG_BPF_SYSCALL
|
||||
.psock_update_sk_prot = unix_bpf_update_proto,
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct sock *unix_create1(struct net *net, struct socket *sock, int kern)
|
||||
@@ -2973,6 +2976,7 @@ static int __init af_unix_init(void)
|
||||
|
||||
sock_register(&unix_family_ops);
|
||||
register_pernet_subsys(&unix_net_ops);
|
||||
unix_bpf_build_proto();
|
||||
out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user