diff mbox series

[net-next,1/3] mptcp: implement dummy MSG_ERRQUEUE support

Message ID 372f93e8d85570f897fd1801cb90f591ef478c2a.1618502178.git.pabeni@redhat.com
State Accepted, archived
Commit 79f8f01a2fbe2e4e2b075a1a1ebdc78f043240f7
Delegated to: Matthieu Baerts
Headers show
Series mptcp: improve MSG_* flags handling | expand

Commit Message

Paolo Abeni April 15, 2021, 4:02 p.m. UTC
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 <pabeni@redhat.com>
 net/mptcp/protocol.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series


diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 0437fe4f0552..ed9ada31f2da 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;