summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_divert.c
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-09-03 22:43:40 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-09-03 22:43:40 +0000
commitfe8bd4c21ccdb6346edd9c98e002219791ef746d (patch)
treee029150b93f2d8115fc1a882774fc87488b29896 /sys/netinet6/ip6_divert.c
parent41377f6c1a23cabe8ffd4a669675e15f7afb4eba (diff)
Move PRU_PEERADDR request to (*pru_peeraddr)().
Introduce in{,6}_peeraddr() and use them for inet and inet6 sockets, except tcp(4) case. Also remove *_usrreq() handlers. ok bluhm@
Diffstat (limited to 'sys/netinet6/ip6_divert.c')
-rw-r--r--sys/netinet6/ip6_divert.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/sys/netinet6/ip6_divert.c b/sys/netinet6/ip6_divert.c
index 892f7fd033d..706d5b9f3b9 100644
--- a/sys/netinet6/ip6_divert.c
+++ b/sys/netinet6/ip6_divert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_divert.c,v 1.84 2022/09/03 18:48:50 mvs Exp $ */
+/* $OpenBSD: ip6_divert.c,v 1.85 2022/09/03 22:43:38 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -64,7 +64,6 @@ const struct sysctl_bounded_args divert6ctl_vars[] = {
};
const struct pr_usrreqs divert6_usrreqs = {
- .pru_usrreq = divert6_usrreq,
.pru_attach = divert6_attach,
.pru_detach = divert6_detach,
.pru_bind = divert6_bind,
@@ -73,6 +72,7 @@ const struct pr_usrreqs divert6_usrreqs = {
.pru_abort = divert6_abort,
.pru_control = in6_control,
.pru_sockaddr = in6_sockaddr,
+ .pru_peeraddr = in6_peeraddr,
};
int divb6hashsize = DIVERTHASHSIZE;
@@ -258,45 +258,6 @@ divert6_packet(struct mbuf *m, int dir, u_int16_t divert_port)
m_freem(m);
}
-/*ARGSUSED*/
-int
-divert6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr,
- struct mbuf *control, struct proc *p)
-{
- struct inpcb *inp = sotoinpcb(so);
- int error = 0;
-
- soassertlocked(so);
-
- if (inp == NULL) {
- error = EINVAL;
- goto release;
- }
- switch (req) {
-
- case PRU_PEERADDR:
- in6_setpeeraddr(inp, addr);
- break;
-
- case PRU_FASTTIMO:
- case PRU_SLOWTIMO:
- case PRU_PROTORCV:
- case PRU_PROTOSEND:
- error = EOPNOTSUPP;
- break;
-
- default:
- panic("%s", __func__);
- }
-
-release:
- if (req != PRU_RCVD && req != PRU_RCVOOB && req != PRU_SENSE) {
- m_freem(control);
- m_freem(m);
- }
- return (error);
-}
-
int
divert6_attach(struct socket *so, int proto)
{