rpc: Convert an SOLISTENING check to an assertion

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

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2021-09-17 12:13:02 -04:00
parent 40fcdb9366
commit 7fabaac221

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)