diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-24 16:11:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-24 16:11:09 +0000 |
commit | 0bdf18c9edb2e6a9fa89a28e89d11e7b6785b1fd (patch) | |
tree | bd0dc86a525e38150bde9f0c3d55ad9dfeb4e6a2 /regress/sys | |
parent | 6e48c70f167662c7aec42af9bafc316e322ef92a (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 'regress/sys')
-rw-r--r-- | regress/sys/kern/unfdpass/unfdpass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/regress/sys/kern/unfdpass/unfdpass.c b/regress/sys/kern/unfdpass/unfdpass.c index 80e6b0ec8fd..68bbad88bfc 100644 --- a/regress/sys/kern/unfdpass/unfdpass.c +++ b/regress/sys/kern/unfdpass/unfdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unfdpass.c,v 1.14 2008/03/15 16:49:15 hshoexer Exp $ */ +/* $OpenBSD: unfdpass.c,v 1.15 2008/03/24 16:11:08 deraadt Exp $ */ /* $NetBSD: unfdpass.c,v 1.3 1998/06/24 23:51:30 thorpej Exp $ */ /*- @@ -173,7 +173,7 @@ main(int argc, char *argv[]) */ (void) memset(&msg, 0, sizeof(msg)); msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = CMSG_LEN(sizeof(int) * 3); + msg.msg_controllen = sizeof(cmsgbuf.buf); if (recvmsg(sock, &msg, 0) < 0) err(1, "recvmsg"); @@ -270,7 +270,7 @@ child(int sock) (void) memset(&msg, 0, sizeof(msg)); msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = CMSG_LEN(sizeof(int) * 3); + msg.msg_controllen = sizeof(cmsgbuf.buf); cmp = CMSG_FIRSTHDR(&msg); cmp->cmsg_len = CMSG_LEN(sizeof(int) * 3); |