FreeBSD Bugzilla – Attachment 244523 Details for
Bug 212716
recv() with MSG_WAITALL doesn't always unblock on EOF
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
sockets: check socket state after call to pr_rcvd() in soreceive_generic()
patch (text/plain), 1.05 KB, created by
Greg Becker
on 2023-08-31 14:57:46 UTC
(
hide
)
Description:
sockets: check socket state after call to pr_rcvd() in soreceive_generic()
Filename:
MIME Type:
Creator:
Greg Becker
Created:
2023-08-31 14:57:46 UTC
Size:
1.05 KB
patch
obsolete
>From d05a0b081eae41e93fda8c6231797fa34da32a21 Mon Sep 17 00:00:00 2001 >From: Greg Becker <becker.greg@att.net> >Date: Thu, 31 Aug 2023 09:44:04 -0500 >Subject: sockets: check socket state after call to pr_rcvd() in > soreceive_generic() > >Socket state may have changed after dropping the receive buffer lock to call >pr_rcvd(), so re-check the state after reaquiring the lock and skip calling >sbwait() if the socket is in error or the peer has closed. >--- > sys/kern/uipc_socket.c | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c >index ffd5e06c34b7..1ab9cc550d28 100644 >--- a/sys/kern/uipc_socket.c >+++ b/sys/kern/uipc_socket.c >@@ -2437,6 +2437,10 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, > * the protocol. Skip blocking in this case. > */ > if (so->so_rcv.sb_mb == NULL) { >+ if (so->so_error || so->so_rerror || >+ so->so_rcv.sb_state & SBS_CANTRCVMORE) >+ break; >+ > error = sbwait(so, SO_RCV); > if (error) { > SOCKBUF_UNLOCK(&so->so_rcv); >-- >2.41.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212716
:
244510
|
244523
|
244533
|
244557
|
244732