From: Paolo Abeni Date: Fri, 23 Apr 2021 18:17:05 +0000 (-0700) Subject: mptcp: implement dummy MSG_ERRQUEUE support X-Git-Tag: v5.15~1236^2~50^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb9d80f4940ee5d4b7c7cad7418a6c893c6c4279;p=platform%2Fkernel%2Flinux-starfive.git mptcp: implement dummy MSG_ERRQUEUE support mptcp_recvmsg() currently silently ignores MSG_ERRQUEUE, returning input data instead of error cmsg. This change provides a dummy implementation for MSG_ERRQUEUE - always returns no data. That is consistent with the current lack of a suitable IP_RECVERR setsockopt() support. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller --- diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index c14ac29..1d5f23b 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1945,6 +1945,10 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int target; long timeo; + /* MSG_ERRQUEUE is really a no-op till we support IP_RECVERR */ + if (unlikely(flags & MSG_ERRQUEUE)) + return inet_recv_error(sk, msg, len, addr_len); + if (msg->msg_flags & ~(MSG_WAITALL | MSG_DONTWAIT)) return -EOPNOTSUPP;