summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/uipc_usrreq.c18
-rw-r--r--sys/net/pfkeyv2.c14
-rw-r--r--sys/net/rtsock.c14
-rw-r--r--sys/netinet/ip_divert.c15
-rw-r--r--sys/netinet/ip_divert.h3
-rw-r--r--sys/netinet/ip_gre.c3
-rw-r--r--sys/netinet/ip_var.h3
-rw-r--r--sys/netinet/raw_ip.c23
-rw-r--r--sys/netinet/tcp_usrreq.c50
-rw-r--r--sys/netinet/tcp_var.h3
-rw-r--r--sys/netinet/udp_usrreq.c17
-rw-r--r--sys/netinet/udp_var.h3
-rw-r--r--sys/netinet6/ip6_divert.c16
-rw-r--r--sys/netinet6/ip6_divert.h3
-rw-r--r--sys/netinet6/ip6_var.h3
-rw-r--r--sys/netinet6/raw_ip6.c20
-rw-r--r--sys/sys/protosw.h6
-rw-r--r--sys/sys/unpcb.h3
18 files changed, 148 insertions, 69 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index a2f827849a5..0a5a1ab92cb 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.173 2022/08/22 13:23:06 mvs Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.174 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -135,6 +135,7 @@ const struct pr_usrreqs uipc_usrreqs = {
.pru_connect = uipc_connect,
.pru_accept = uipc_accept,
.pru_disconnect = uipc_disconnect,
+ .pru_shutdown = uipc_shutdown,
};
void
@@ -242,11 +243,6 @@ uipc_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
}
break;
- case PRU_SHUTDOWN:
- socantsendmore(so);
- unp_shutdown(unp);
- break;
-
case PRU_RCVD:
switch (so->so_type) {
@@ -565,6 +561,16 @@ uipc_disconnect(struct socket *so)
}
int
+uipc_shutdown(struct socket *so)
+{
+ struct unpcb *unp = sotounpcb(so);
+
+ socantsendmore(so);
+ unp_shutdown(unp);
+ return (0);
+}
+
+int
uipc_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
size_t newlen)
{
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index 193c6be10bc..8fbac63bf33 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.240 2022/08/22 13:23:06 mvs Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.241 2022/08/22 21:18:48 mvs Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -172,6 +172,7 @@ void pfkey_init(void);
int pfkeyv2_attach(struct socket *, int);
int pfkeyv2_detach(struct socket *);
int pfkeyv2_disconnect(struct socket *);
+int pfkeyv2_shutdown(struct socket *);
int pfkeyv2_usrreq(struct socket *, int, struct mbuf *, struct mbuf *,
struct mbuf *, struct proc *);
int pfkeyv2_output(struct mbuf *, struct socket *, struct sockaddr *,
@@ -205,6 +206,7 @@ const struct pr_usrreqs pfkeyv2_usrreqs = {
.pru_attach = pfkeyv2_attach,
.pru_detach = pfkeyv2_detach,
.pru_disconnect = pfkeyv2_disconnect,
+ .pru_shutdown = pfkeyv2_shutdown,
};
const struct protosw pfkeysw[] = {
@@ -342,6 +344,13 @@ pfkeyv2_disconnect(struct socket *so)
}
int
+pfkeyv2_shutdown(struct socket *so)
+{
+ socantsendmore(so);
+ return (0);
+}
+
+int
pfkeyv2_usrreq(struct socket *so, int req, struct mbuf *m,
struct mbuf *nam, struct mbuf *control, struct proc *p)
{
@@ -373,9 +382,6 @@ pfkeyv2_usrreq(struct socket *so, int req, struct mbuf *m,
case PRU_ABORT:
soisdisconnected(so);
break;
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
case PRU_SENSE:
/* stat: don't bother with a blocksize. */
break;
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index a9ad3b593a0..6f4ba086c9c 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.340 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: rtsock.c,v 1.341 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -115,6 +115,7 @@ int route_ctloutput(int, struct socket *, int, int, struct mbuf *);
int route_usrreq(struct socket *, int, struct mbuf *, struct mbuf *,
struct mbuf *, struct proc *);
int route_disconnect(struct socket *);
+int route_shutdown(struct socket *);
void route_input(struct mbuf *m0, struct socket *, sa_family_t);
int route_arp_conflict(struct rtentry *, struct rt_addrinfo *);
int route_cleargateway(struct rtentry *, void *, unsigned int);
@@ -241,9 +242,6 @@ route_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
case PRU_ABORT:
soisdisconnected(so);
break;
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
case PRU_SENSE:
/* stat: don't bother with a blocksize. */
break;
@@ -370,6 +368,13 @@ route_disconnect(struct socket *so)
}
int
+route_shutdown(struct socket *so)
+{
+ socantsendmore(so);
+ return (0);
+}
+
+int
route_ctloutput(int op, struct socket *so, int level, int optname,
struct mbuf *m)
{
@@ -2409,6 +2414,7 @@ const struct pr_usrreqs route_usrreqs = {
.pru_attach = route_attach,
.pru_detach = route_detach,
.pru_disconnect = route_disconnect,
+ .pru_shutdown = route_shutdown,
};
const struct protosw routesw[] = {
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 8447b4afbcc..2f61c4acc25 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_divert.c,v 1.75 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: ip_divert.c,v 1.76 2022/08/22 21:18:48 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -67,6 +67,7 @@ const struct pr_usrreqs divert_usrreqs = {
.pru_attach = divert_attach,
.pru_detach = divert_detach,
.pru_bind = divert_bind,
+ .pru_shutdown = divert_shutdown,
};
int divbhashsize = DIVERTHASHSIZE;
@@ -268,10 +269,6 @@ divert_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr,
}
switch (req) {
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
case PRU_SEND:
return (divert_output(inp, m, addr, control));
@@ -360,6 +357,14 @@ divert_bind(struct socket *so, struct mbuf *addr, struct proc *p)
}
int
+divert_shutdown(struct socket *so)
+{
+ soassertlocked(so);
+ socantsendmore(so);
+ return (0);
+}
+
+int
divert_sysctl_divstat(void *oldp, size_t *oldlenp, void *newp)
{
uint64_t counters[divs_ncounters];
diff --git a/sys/netinet/ip_divert.h b/sys/netinet/ip_divert.h
index 09b7de4b54e..c3009f6a16e 100644
--- a/sys/netinet/ip_divert.h
+++ b/sys/netinet/ip_divert.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_divert.h,v 1.17 2022/08/20 23:48:58 mvs Exp $ */
+/* $OpenBSD: ip_divert.h,v 1.18 2022/08/22 21:18:48 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -75,5 +75,6 @@ int divert_usrreq(struct socket *,
int divert_attach(struct socket *, int);
int divert_detach(struct socket *);
int divert_bind(struct socket *, struct mbuf *, struct proc *);
+int divert_shutdown(struct socket *);
#endif /* _KERNEL */
#endif /* _IP_DIVERT_H_ */
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
index 597b702fb6f..6ffa80a60cc 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_gre.c,v 1.78 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.79 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -68,6 +68,7 @@ const struct pr_usrreqs gre_usrreqs = {
.pru_bind = rip_bind,
.pru_connect = rip_connect,
.pru_disconnect = rip_disconnect,
+ .pru_shutdown = rip_shutdown,
};
int
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h
index 6ae3b26b796..6ad01c463c2 100644
--- a/sys/netinet/ip_var.h
+++ b/sys/netinet/ip_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_var.h,v 1.100 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: ip_var.h,v 1.101 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */
/*
@@ -263,6 +263,7 @@ int rip_detach(struct socket *);
int rip_bind(struct socket *so, struct mbuf *, struct proc *);
int rip_connect(struct socket *, struct mbuf *);
int rip_disconnect(struct socket *);
+int rip_shutdown(struct socket *);
#ifdef MROUTING
extern struct socket *ip_mrouter[]; /* multicast routing daemon */
#endif
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index d6d0394612c..7794610a6ab 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip.c,v 1.136 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.137 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
@@ -110,6 +110,7 @@ const struct pr_usrreqs rip_usrreqs = {
.pru_bind = rip_bind,
.pru_connect = rip_connect,
.pru_disconnect = rip_disconnect,
+ .pru_shutdown = rip_shutdown,
};
/*
@@ -491,13 +492,6 @@ rip_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
break;
/*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
- /*
* Ship a packet out. The appropriate raw output
* routine handles any massaging necessary.
*/
@@ -666,3 +660,16 @@ rip_disconnect(struct socket *so)
return (0);
}
+
+int
+rip_shutdown(struct socket *so)
+{
+ /*
+ * Mark the connection as being incapable of further input.
+ */
+
+ soassertlocked(so);
+ socantsendmore(so);
+
+ return (0);
+}
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index b1542ce376e..e99ed008f9b 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.193 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.194 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -120,6 +120,7 @@ const struct pr_usrreqs tcp_usrreqs = {
.pru_connect = tcp_connect,
.pru_accept = tcp_accept,
.pru_disconnect = tcp_disconnect,
+ .pru_shutdown = tcp_shutdown,
};
static int pr_slowhz = PR_SLOWHZ;
@@ -224,18 +225,6 @@ tcp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
break;
/*
- * Mark the connection as being incapable of further output.
- */
- case PRU_SHUTDOWN:
- if (so->so_state & SS_CANTSENDMORE)
- break;
- socantsendmore(so);
- tp = tcp_usrclosed(tp);
- if (tp)
- error = tcp_output(tp);
- break;
-
- /*
* After a receive, possibly send window update to peer.
*/
case PRU_RCVD:
@@ -891,6 +880,41 @@ tcp_disconnect(struct socket *so)
}
/*
+ * Mark the connection as being incapable of further output.
+ */
+int
+tcp_shutdown(struct socket *so)
+{
+ struct inpcb *inp;
+ struct tcpcb *tp, *otp = NULL;
+ int error;
+ short ostate;
+
+ soassertlocked(so);
+
+ if ((error = tcp_sogetpcb(so, &inp, &tp)))
+ return (error);
+
+ if (so->so_options & SO_DEBUG) {
+ otp = tp;
+ ostate = tp->t_state;
+ }
+
+ if (so->so_state & SS_CANTSENDMORE)
+ goto out;
+
+ socantsendmore(so);
+ tp = tcp_usrclosed(tp);
+ if (tp)
+ error = tcp_output(tp);
+
+out:
+ if (otp)
+ tcp_trace(TA_USER, ostate, tp, otp, NULL, PRU_SHUTDOWN, 0);
+ return (error);
+}
+
+/*
* Initiate (or continue) disconnect.
* If embryonic state, just send reset (once).
* If in ``let data drain'' option and linger null, just drop.
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 1184fb9be54..7902c6b7cf7 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_var.h,v 1.146 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.147 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
@@ -719,6 +719,7 @@ int tcp_listen(struct socket *);
int tcp_connect(struct socket *, struct mbuf *);
int tcp_accept(struct socket *, struct mbuf *);
int tcp_disconnect(struct socket *);
+int tcp_shutdown(struct socket *);
void tcp_xmit_timer(struct tcpcb *, int);
void tcpdropoldhalfopen(struct tcpcb *, u_int16_t);
void tcp_sack_option(struct tcpcb *,struct tcphdr *,u_char *,int);
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 317bb0a64c9..0fc71754fff 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.288 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.289 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -129,6 +129,7 @@ const struct pr_usrreqs udp_usrreqs = {
.pru_bind = udp_bind,
.pru_connect = udp_connect,
.pru_disconnect = udp_disconnect,
+ .pru_shutdown = udp_shutdown,
};
const struct sysctl_bounded_args udpctl_vars[] = {
@@ -1085,10 +1086,6 @@ udp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr,
error = EOPNOTSUPP;
break;
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
case PRU_SEND:
#ifdef PIPEX
if (inp->inp_pipex) {
@@ -1288,7 +1285,15 @@ udp_disconnect(struct socket *so)
return (0);
}
-
+
+int
+udp_shutdown(struct socket *so)
+{
+ soassertlocked(so);
+ socantsendmore(so);
+ return (0);
+}
+
/*
* Sysctl for udp variables.
*/
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index df3149a8698..945695ba3c5 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_var.h,v 1.41 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: udp_var.h,v 1.42 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: udp_var.h,v 1.12 1996/02/13 23:44:41 christos Exp $ */
/*
@@ -146,5 +146,6 @@ int udp_detach(struct socket *);
int udp_bind(struct socket *, struct mbuf *, struct proc *);
int udp_connect(struct socket *, struct mbuf *);
int udp_disconnect(struct socket *);
+int udp_shutdown(struct socket *);
#endif /* _KERNEL */
#endif /* _NETINET_UDP_VAR_H_ */
diff --git a/sys/netinet6/ip6_divert.c b/sys/netinet6/ip6_divert.c
index 3526fd56912..3b3ae067b7f 100644
--- a/sys/netinet6/ip6_divert.c
+++ b/sys/netinet6/ip6_divert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_divert.c,v 1.74 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: ip6_divert.c,v 1.75 2022/08/22 21:18:48 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -68,6 +68,7 @@ const struct pr_usrreqs divert6_usrreqs = {
.pru_attach = divert6_attach,
.pru_detach = divert6_detach,
.pru_bind = divert6_bind,
+ .pru_shutdown = divert6_shutdown,
};
int divb6hashsize = DIVERTHASHSIZE;
@@ -274,10 +275,6 @@ divert6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr,
}
switch (req) {
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
-
case PRU_SEND:
return (divert6_output(inp, m, addr, control));
@@ -367,6 +364,15 @@ divert6_bind(struct socket *so, struct mbuf *addr, struct proc *p)
}
int
+divert6_shutdown(struct socket *so)
+{
+ soassertlocked(so);
+ socantsendmore(so);
+
+ return (0);
+}
+
+int
divert6_sysctl_div6stat(void *oldp, size_t *oldlenp, void *newp)
{
uint64_t counters[div6s_ncounters];
diff --git a/sys/netinet6/ip6_divert.h b/sys/netinet6/ip6_divert.h
index a17549c6ef0..9bf1b6ab1ba 100644
--- a/sys/netinet6/ip6_divert.h
+++ b/sys/netinet6/ip6_divert.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_divert.h,v 1.15 2022/08/20 23:48:58 mvs Exp $ */
+/* $OpenBSD: ip6_divert.h,v 1.16 2022/08/22 21:18:48 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -75,6 +75,7 @@ int divert6_usrreq(struct socket *,
int divert6_attach(struct socket *, int);
int divert6_detach(struct socket *);
int divert6_bind(struct socket *, struct mbuf *, struct proc *);
+int divert6_shutdown(struct socket *);
#endif /* _KERNEL */
#endif /* _IP6_DIVERT_H_ */
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index f60742da02c..63ec50bfa04 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_var.h,v 1.98 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: ip6_var.h,v 1.99 2022/08/22 21:18:48 mvs Exp $ */
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
/*
@@ -358,6 +358,7 @@ int rip6_detach(struct socket *);
int rip6_bind(struct socket *, struct mbuf *, struct proc *);
int rip6_connect(struct socket *, struct mbuf *);
int rip6_disconnect(struct socket *);
+int rip6_shutdown(struct socket *);
int rip6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int dest6_input(struct mbuf **, int *, int, int);
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 23b6991baa4..f80c9fe5d88 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.156 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.157 2022/08/22 21:18:48 mvs Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -112,6 +112,7 @@ const struct pr_usrreqs rip6_usrreqs = {
.pru_bind = rip6_bind,
.pru_connect = rip6_connect,
.pru_disconnect = rip6_disconnect,
+ .pru_shutdown = rip6_shutdown,
};
/*
@@ -609,12 +610,6 @@ rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
break;
/*
- * Mark the connection as being incapable of further input.
- */
- case PRU_SHUTDOWN:
- socantsendmore(so);
- break;
- /*
* Ship a packet out. The appropriate raw output
* routine handles any messaging necessary.
*/
@@ -802,6 +797,17 @@ rip6_disconnect(struct socket *so)
}
int
+rip6_shutdown(struct socket *so)
+{
+ /*
+ * Mark the connection as being incapable of further input.
+ */
+ soassertlocked(so);
+ socantsendmore(so);
+ return (0);
+}
+
+int
rip6_sysctl_rip6stat(void *oldp, size_t *oldplen, void *newp)
{
struct rip6stat rip6stat;
diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h
index 5c9d50ad9e0..18510ef9e42 100644
--- a/sys/sys/protosw.h
+++ b/sys/sys/protosw.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: protosw.h,v 1.42 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: protosw.h,v 1.43 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */
/*-
@@ -71,6 +71,7 @@ struct pr_usrreqs {
int (*pru_connect)(struct socket *, struct mbuf *);
int (*pru_accept)(struct socket *, struct mbuf *);
int (*pru_disconnect)(struct socket *);
+ int (*pru_shutdown)(struct socket *);
};
struct protosw {
@@ -309,8 +310,7 @@ pru_disconnect(struct socket *so)
static inline int
pru_shutdown(struct socket *so)
{
- return (*so->so_proto->pr_usrreqs->pru_usrreq)(so,
- PRU_SHUTDOWN, NULL, NULL, NULL, curproc);
+ return (*so->so_proto->pr_usrreqs->pru_shutdown)(so);
}
static inline int
diff --git a/sys/sys/unpcb.h b/sys/sys/unpcb.h
index 3020786a7dc..4a51945945f 100644
--- a/sys/sys/unpcb.h
+++ b/sys/sys/unpcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unpcb.h,v 1.32 2022/08/22 13:23:07 mvs Exp $ */
+/* $OpenBSD: unpcb.h,v 1.33 2022/08/22 21:18:48 mvs Exp $ */
/* $NetBSD: unpcb.h,v 1.6 1994/06/29 06:46:08 cgd Exp $ */
/*
@@ -118,6 +118,7 @@ int uipc_listen(struct socket *);
int uipc_connect(struct socket *, struct mbuf *);
int uipc_accept(struct socket *, struct mbuf *);
int uipc_disconnect(struct socket *);
+int uipc_shutdown(struct socket *);
void unp_init(void);
int unp_bind(struct unpcb *, struct mbuf *, struct proc *);