]> git.baikalelectronics.ru Git - kernel.git/commit
sock: Introduce sk->sk_prot->psock_update_sk_prot()
authorCong Wang <cong.wang@bytedance.com>
Wed, 31 Mar 2021 02:32:31 +0000 (19:32 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 1 Apr 2021 17:56:14 +0000 (10:56 -0700)
commitdf7c8df97eba8b439f3505c9f611f4fd300e6416
tree22d59950e745c697e01c05b82ed67d7a9536bd88
parent94179354b25cf817b7d684e124ee5c569240716c
sock: Introduce sk->sk_prot->psock_update_sk_prot()

Currently sockmap calls into each protocol to update the struct
proto and replace it. This certainly won't work when the protocol
is implemented as a module, for example, AF_UNIX.

Introduce a new ops sk->sk_prot->psock_update_sk_prot(), so each
protocol can implement its own way to replace the struct proto.
This also helps get rid of symbol dependencies on CONFIG_INET.

Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210331023237.41094-11-xiyou.wangcong@gmail.com
12 files changed:
include/linux/skmsg.h
include/net/sock.h
include/net/tcp.h
include/net/udp.h
net/core/skmsg.c
net/core/sock_map.c
net/ipv4/tcp_bpf.c
net/ipv4/tcp_ipv4.c
net/ipv4/udp.c
net/ipv4/udp_bpf.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c