aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-10-27 00:25:57 +0100
committerJakub Kicinski <kuba@kernel.org>2022-10-28 20:21:25 -0700
commitfee9ac06647e59a69fb7aec58f25267c134264b4 (patch)
tree1e0dcc256b6989057ca328e93d0aac846722405b /include
parentudp: advertise ipv6 udp support for msghdr::ubuf_info (diff)
downloadlinux-dev-fee9ac06647e59a69fb7aec58f25267c134264b4.tar.xz
linux-dev-fee9ac06647e59a69fb7aec58f25267c134264b4.zip
net: remove SOCK_SUPPORT_ZC from sockmap
sockmap replaces ->sk_prot with its own callbacks, we should remove SOCK_SUPPORT_ZC as the new proto doesn't support msghdr::ubuf_info. Cc: <stable@vger.kernel.org> # 6.0 Reported-by: Jakub Kicinski <kuba@kernel.org> Fixes: e993ffe3da4bc ("net: flag sockets supporting msghdr originated zerocopy") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 22f8bab583dd..5db02546941c 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1889,6 +1889,13 @@ void sock_kfree_s(struct sock *sk, void *mem, int size);
void sock_kzfree_s(struct sock *sk, void *mem, int size);
void sk_send_sigurg(struct sock *sk);
+static inline void sock_replace_proto(struct sock *sk, struct proto *proto)
+{
+ if (sk->sk_socket)
+ clear_bit(SOCK_SUPPORT_ZC, &sk->sk_socket->flags);
+ WRITE_ONCE(sk->sk_prot, proto);
+}
+
struct sockcm_cookie {
u64 transmit_time;
u32 mark;