summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
commit0bdf18c9edb2e6a9fa89a28e89d11e7b6785b1fd (patch)
treebd0dc86a525e38150bde9f0c3d55ad9dfeb4e6a2 /usr.sbin/relayd
parent6e48c70f167662c7aec42af9bafc316e322ef92a (diff)
msg_controllen has to be CMSG_SPACE so that the kernel can account for
each cmsg_len (ie. msg_controllen = sum of CMSG_ALIGN(cmsg_len). This works now that kernel fd passing has been fixed to accept a bit of sloppiness because of this ABI repair. lots of discussion with kettenis
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/buffer.c6
-rw-r--r--usr.sbin/relayd/imsg.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/relayd/buffer.c b/usr.sbin/relayd/buffer.c
index 52f5bac4465..60a39d07e05 100644
--- a/usr.sbin/relayd/buffer.c
+++ b/usr.sbin/relayd/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.11 2008/03/15 16:19:02 deraadt Exp $ */
+/* $OpenBSD: buffer.c,v 1.12 2008/03/24 16:11:05 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -181,7 +181,7 @@ msgbuf_write(struct msgbuf *msgbuf)
if (buf != NULL && buf->fd != -1) {
msg.msg_control = (caddr_t)&cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(int));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
@@ -204,7 +204,7 @@ msgbuf_write(struct msgbuf *msgbuf)
if (buf != NULL && buf->fd != -1) {
msg.msg_control = (caddr_t)&cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(int));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
diff --git a/usr.sbin/relayd/imsg.c b/usr.sbin/relayd/imsg.c
index d42dc9c252f..c65f4b6d92c 100644
--- a/usr.sbin/relayd/imsg.c
+++ b/usr.sbin/relayd/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.13 2008/03/15 16:25:00 deraadt Exp $ */
+/* $OpenBSD: imsg.c,v 1.14 2008/03/24 16:11:05 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -68,7 +68,7 @@ imsg_read(struct imsgbuf *ibuf)
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(int) * 16);
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
if ((n = recvmsg(ibuf->fd, &msg, 0)) == -1) {
if (errno != EINTR && errno != EAGAIN) {