summaryrefslogtreecommitdiff
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-09-03 18:48:51 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-09-03 18:48:51 +0000
commitb74deec071b622bf75e369b894f29a81d2d7329c (patch)
tree5c977f410a8599b1bfcc7de57478fbb7018ab689 /sys/netinet/in_pcb.c
parenta06d57e8bc374eb2babce93aba9a7b90ac53fa3f (diff)
Move PRU_SOCKADDR request to (*pru_sockaddr)()
Introduce in{,6}_sockaddr() functions, and use them for all except tcp(4) inet sockets. For tcp(4) sockets use tcp_sockaddr() to keep debug ability. The key management and route domain sockets returns EINVAL error for PRU_SOCKADDR request, so keep this behaviour for a while instead of make pru_sockaddr handler optional and return EOPNOTSUPP. ok bluhm@
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index b326f3f14df..49b19ebc03f 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.273 2022/08/30 11:53:04 bluhm Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.274 2022/09/03 18:48:50 mvs Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -665,6 +665,17 @@ in_setpeeraddr(struct inpcb *inp, struct mbuf *nam)
sin->sin_addr = inp->inp_faddr;
}
+int
+in_sockaddr(struct socket *so, struct mbuf *nam)
+{
+ struct inpcb *inp;
+
+ inp = sotoinpcb(so);
+ in_setsockaddr(inp, nam);
+
+ return (0);
+}
+
/*
* Pass some notification to all connections of a protocol
* associated with address dst. The "usual action" will be