summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2017-01-27 20:31:42 +0000
committerbluhm <bluhm@openbsd.org>2017-01-27 20:31:42 +0000
commit90bf2aa3489f6e799e806e59f688f5cfcf7c7216 (patch)
tree61f2e9220bab3a7d585d6654c3376e00f98ce1eb /sys/kern/uipc_socket.c
parentFix Copyright notices; ok beck@ jsing@ tedu@ (diff)
downloadwireguard-openbsd-90bf2aa3489f6e799e806e59f688f5cfcf7c7216.tar.xz
wireguard-openbsd-90bf2aa3489f6e799e806e59f688f5cfcf7c7216.zip
In sosend() the size of the control message for file descriptor
passing is checked. As the data type has changed in unp_internalize(), the calculation has to be adapted in sosend(). Found by relayd regress test on i386. OK millert@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 10f82b9d272..0c3171a8187 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.174 2017/01/26 00:08:50 bluhm Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.175 2017/01/27 20:31:42 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -415,7 +415,7 @@ sosend(struct socket *so, struct mbuf *addr, struct uio *uio, struct mbuf *top,
mtod(control, struct cmsghdr *)->cmsg_type == SCM_RIGHTS)
clen = CMSG_SPACE(
(clen - CMSG_ALIGN(sizeof(struct cmsghdr))) *
- (sizeof(struct file *) / sizeof(int)));
+ (sizeof(struct fdpass) / sizeof(int)));
}
#define snderr(errno) { error = errno; NET_UNLOCK(s); goto release; }