summaryrefslogtreecommitdiff
path: root/libexec/tftpd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-15 16:25:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-15 16:25:01 +0000
commit8332edeb582077739f86f898af5876386fbefc00 (patch)
tree0bd3f1a3f041252e7c1653278f43184cce9771a3 /libexec/tftpd
parent76cd87afedab46927375dd0ceabdedd0d5d56714 (diff)
Repair more msg_controllen dealing with structures or arrays of
descriptors; ok hshoexer, also looked at by kettenis and henning
Diffstat (limited to 'libexec/tftpd')
-rw-r--r--libexec/tftpd/tftpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index b22b3f48d60..0fe4c9c1535 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftpd.c,v 1.60 2008/03/13 01:49:52 deraadt Exp $ */
+/* $OpenBSD: tftpd.c,v 1.61 2008/03/15 16:25:00 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)tftpd.c 5.13 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$OpenBSD: tftpd.c,v 1.60 2008/03/13 01:49:52 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tftpd.c,v 1.61 2008/03/15 16:25:00 deraadt Exp $";
#endif /* not lint */
/*
@@ -286,7 +286,7 @@ main(int argc, char *argv[])
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = sizeof(cmsgbuf.buf);
+ msg.msg_controllen = CMSG_LEN(sizeof(struct sockaddr_storage));
n = recvmsg(fd, &msg, 0);
if (n < 0) {
@@ -330,7 +330,7 @@ main(int argc, char *argv[])
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = sizeof(cmsgbuf.buf);
+ msg.msg_controllen = CMSG_LEN(sizeof(struct sockaddr_storage));
i = recvmsg(fd, &msg, 0);
if (i > 0)