summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-08-20 23:48:59 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-08-20 23:48:59 +0000
commit76161c54839f8357fa21570c80b34c0e4c85e734 (patch)
treebee47fc97862ea9cae0230e1b2e22d20b1f80ba2 /sys/kern/uipc_usrreq.c
parent645a3a4b5060642d99ad9e7574c8014c6f1dfc27 (diff)
Move PRU_BIND request to (*pru_bind)() handler.
For the protocols which don't support request, leave handler NULL. Do the NULL check within corresponding pru_() wrapper and return EOPNOTSUPP in such case. This will be done for all upcoming user request handlers. ok bluhm@ guenther@
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 55a2fc64bac..880e83391d7 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.168 2022/08/15 09:11:38 mvs Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.169 2022/08/20 23:48:57 mvs Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -130,6 +130,7 @@ const struct pr_usrreqs uipc_usrreqs = {
.pru_usrreq = uipc_usrreq,
.pru_attach = uipc_attach,
.pru_detach = uipc_detach,
+ .pru_bind = uipc_bind,
};
void
@@ -222,10 +223,6 @@ uipc_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
switch (req) {
- case PRU_BIND:
- error = unp_bind(unp, nam, p);
- break;
-
case PRU_LISTEN:
if (unp->unp_vnode == NULL)
error = EINVAL;
@@ -538,6 +535,14 @@ uipc_detach(struct socket *so)
}
int
+uipc_bind(struct socket *so, struct mbuf *nam, struct proc *p)
+{
+ struct unpcb *unp = sotounpcb(so);
+
+ return unp_bind(unp, nam, p);
+}
+
+int
uipc_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
size_t newlen)
{