summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/uipc_socket.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 68685c0d83f..3d6e12e88bc 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.245 2020/06/15 15:29:40 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.246 2020/06/18 14:05:21 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1200,6 +1200,10 @@ sosplice(struct socket *so, int fd, off_t max, struct timeval *tv)
if ((error = getsock(curproc, fd, &fp)) != 0)
return (error);
sosp = fp->f_data;
+ if (sosp->so_proto->pr_usrreq != so->so_proto->pr_usrreq) {
+ error = EPROTONOSUPPORT;
+ goto frele;
+ }
if (sosp->so_sp == NULL) {
sp = pool_get(&sosplice_pool, PR_WAITOK | PR_ZERO);
if (sosp->so_sp == NULL)
@@ -1221,10 +1225,6 @@ sosplice(struct socket *so, int fd, off_t max, struct timeval *tv)
error = EBUSY;
goto release;
}
- if (sosp->so_proto->pr_usrreq != so->so_proto->pr_usrreq) {
- error = EPROTONOSUPPORT;
- goto release;
- }
if (sosp->so_options & SO_ACCEPTCONN) {
error = EOPNOTSUPP;
goto release;