DORMANTno replies

[PATCH net-next v2 v2 2/2] net: mctp: support MSG_ERRQUEUE in recvmsg()

From: Jian Zhang <hidden>
Date: 2026-01-16 09:00:57
Also in: lkml
Subsystem: management component transport protocol (mctp), networking [general], the rest · Maintainers: Jeremy Kerr, Matt Johnston, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

This enables userspace to retrieve struct sock_extended_err for
locally detected transmit failures, using the standard socket
error queue mechanism.

At this point, only the generic errno information is reported.
No MCTP-specific control messages or extended error details are
provided.

Signed-off-by: Jian Zhang <redacted>
---
 net/mctp/af_mctp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index 209a963112e3..353599812a0a 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -291,9 +291,12 @@ static int mctp_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 	u8 type;
 	int rc;
 
-	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
+	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK | MSG_ERRQUEUE))
 		return -EOPNOTSUPP;
 
+	if (flags & MSG_ERRQUEUE)
+		return sock_recv_errqueue(sk, msg, len, SOL_MCTP, 0);
+
 	skb = skb_recv_datagram(sk, flags, &rc);
 	if (!skb)
 		return rc;
-- 
2.20.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help