From 7fabaac2211e7ed1cec9650e46f4e03428411dcf Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 17 Sep 2021 12:13:02 -0400 Subject: 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 --- sys/rpc/svc_vc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index d81c0b01d84d..77452d906594 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -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) -- cgit v1.2.3