aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-09-17 16:13:02 +0000
committerMark Johnston <markj@FreeBSD.org>2021-09-17 18:19:05 +0000
commit7fabaac2211e7ed1cec9650e46f4e03428411dcf (patch)
treea8de8b24d1b7980d7eddef7a0aa2b2840575b7d9
parent40fcdb9366d51400259020accaac9df212bd9508 (diff)
downloadsrc-7fabaac2211e7ed1cec9650e46f4e03428411dcf.tar.gz
src-7fabaac2211e7ed1cec9650e46f4e03428411dcf.zip
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
-rw-r--r--sys/rpc/svc_vc.c8
1 files 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)