summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-15 16:23:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-15 16:23:28 +0000
commit76cd87afedab46927375dd0ceabdedd0d5d56714 (patch)
tree89facb1efbe230856d66bbfabd0480be9581a7f6 /usr.sbin
parent4e21997d99bba966cb7bcf94c8c986448d4b6d75 (diff)
repair msg_controllen and also an errant buf[CMSG_LEN(..)] decl
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/route6d/route6d.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index 236a0456193..4b67a6cfa0b 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route6d.c,v 1.49 2008/03/13 01:49:53 deraadt Exp $ */
+/* $OpenBSD: route6d.c,v 1.50 2008/03/15 16:23:27 deraadt Exp $ */
/* $KAME: route6d.c,v 1.111 2006/10/25 06:38:13 jinmei Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#if 0
-static char _rcsid[] = "$OpenBSD: route6d.c,v 1.49 2008/03/13 01:49:53 deraadt Exp $";
+static char _rcsid[] = "$OpenBSD: route6d.c,v 1.50 2008/03/15 16:23:27 deraadt Exp $";
#endif
#include <stdio.h>
@@ -965,7 +965,7 @@ sendpacket(struct sockaddr_in6 *sin6, int len)
} else {
memset(&cmsgbuf, 0, sizeof(cmsgbuf));
m.msg_control = (caddr_t)&cmsgbuf.buf;
- m.msg_controllen = sizeof(cmsgbuf.buf);
+ m.msg_controllen = CMSG_LEN(sizeof(struct in6_pktinfo));
cm = CMSG_FIRSTHDR(&m);
cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
cm->cmsg_level = IPPROTO_IPV6;
@@ -1005,7 +1005,7 @@ riprecv(void)
struct iovec iov[2];
union {
struct cmsghdr hdr;
- u_char buf[CMSG_LEN(sizeof(struct in6_pktinfo))];
+ u_char buf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
} cmsgbuf;
struct in6_pktinfo *pi = NULL;
int *hlimp = NULL;
@@ -1023,7 +1023,7 @@ riprecv(void)
m.msg_iov = iov;
m.msg_iovlen = 1;
m.msg_control = (caddr_t)&cmsgbuf.buf;
- m.msg_controllen = sizeof(cmsgbuf.buf);
+ m.msg_controllen = CMSG_LEN(sizeof(struct in6_pktinfo));
if ((len = recvmsg(ripsock, &m, 0)) < 0) {
fatal("recvmsg");
/*NOTREACHED*/