HomeFreeBSD

sockets: re-check socket state after call to pr_rcvd()

Description

sockets: re-check socket state after call to pr_rcvd()

Socket state may have changed after dropping the receive
buffer lock in order to call pr_rcvd(). If the buffer is
empty, re-check the state after reaquiring the lock and
skip calling sbwait() if the socket is in error or the
peer has closed.

PR: 212716
Reviewed by: markj, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41783

(cherry picked from commit f44102411e1b16363e91a074c9c403069c550e4d)

Details

Provenance
becker.greg_att.netAuthored on Sep 9 2023, 11:38 PM
markjCommitted on Sep 27 2023, 12:33 PM
Reviewer
markj
Differential Revision
D41783: sockets: re-check socket state after call to pr_rcvd()
Parents
rG66b87decbf1e: unix tests: Use the right type for sendmsg(2) return values
Branches
Unknown
Tags
Unknown