diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-13 01:49:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-13 01:49:54 +0000 |
commit | f806a02a48dffd4879055cd8cdc1895a0a6c926e (patch) | |
tree | 6c61227927ac37c4d373490dda12a0ed461491c8 /usr.sbin/ospf6d | |
parent | 2d29c72143d0f8408606ffb11045f029da0762f6 (diff) |
Correct CMSG_SPACE and CMSG_LEN usage everywhere in the tree. Due to
an extensive discussion with otto, kettenis, millert, and hshoexer
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r-- | usr.sbin/ospf6d/packet.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/ospf6d/packet.c b/usr.sbin/ospf6d/packet.c index 2f549e82466..96058ebfe52 100644 --- a/usr.sbin/ospf6d/packet.c +++ b/usr.sbin/ospf6d/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.6 2007/12/13 08:54:05 claudio Exp $ */ +/* $OpenBSD: packet.c,v 1.7 2008/03/13 01:49:53 deraadt Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -116,7 +116,10 @@ send_packet(struct iface *iface, void *pkt, size_t len, void recv_packet(int fd, short event, void *bula) { - char cbuf[CMSG_SPACE(sizeof(struct in6_pktinfo))]; + union { + struct cmsghdr hdr; + char buf[CMSG_SPACE(sizeof(struct in6_pktinfo))]; + } cmsgbuf; struct msghdr msg; struct iovec iov; struct in6_addr addr, dest; @@ -143,8 +146,8 @@ recv_packet(int fd, short event, void *bula) msg.msg_namelen = sizeof(src); msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); + msg.msg_control = &cmsgbuf.buf; + msg.msg_controllen = sizeof(cmsgbuf.buf); if ((r = recvmsg(fd, &msg, 0)) == -1) { if (errno != EAGAIN && errno != EINTR) |