sctp: support MSG_ERRQUEUE flag in recvmsg()
authorEric Dumazet <edumazet@google.com>
Tue, 12 Dec 2023 14:55:50 +0000 (14:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:30 +0000 (15:35 -0800)
commit9702e7fb6399d8caed2e7953461068f7204ce39b
tree4b369601ec2ee92aba94f89641f7dd2ff9c09be5
parentb54d78d57985a43d4eab0bf52439af357816771d
sctp: support MSG_ERRQUEUE flag in recvmsg()

[ Upstream commit 4746b36b1abe11ca32987b2d21e1e770deab17cc ]

For some reason sctp_poll() generates EPOLLERR if sk->sk_error_queue
is not empty but recvmsg() can not drain the error queue yet.

This is needed to better support timestamping.

I had to export inet_recv_error(), since sctp
can be compiled as a module.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/20231212145550.3872051-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: a562c0a2d651 ("sctp: fix busy polling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/af_inet.c
net/sctp/socket.c