rpc: Convert an SOLISTENING check to an assertion

Per the comment, this socket should always be a listening socket.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7fabaac221)
This commit is contained in:
Mark Johnston 2021-09-17 12:13:02 -04:00
parent bd4fbd4e14
commit cb7bb946f7

View File

@ -328,11 +328,9 @@ svc_vc_accept(struct socket *head, struct socket **sop)
int error = 0;
short nbio;
/* XXXGL: shouldn't that be an assertion? */
if (!SOLISTENING(head)) {
error = EINVAL;
goto done;
}
KASSERT(SOLISTENING(head),
("%s: socket %p is not listening", __func__, head));
#ifdef MAC
error = mac_socket_check_accept(curthread->td_ucred, head);
if (error != 0)