summaryrefslogtreecommitdiffstats
path: root/src/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-21 09:55:50 +0100
committerRoy Marples <roy@marples.name>2020-04-21 09:59:40 +0100
commit713c37d6b40baf02a90cbc6479529442cb35ec55 (patch)
tree2be9b4af1cb3e59f2aa66867d0dc319740ca9e7c /src/ipv6nd.c
parent1dc1fce7ae7b4c106a8eb631ed92ab1ed8e86bbc (diff)
downloaddhcpcd-713c37d6b40baf02a90cbc6479529442cb35ec55.tar.xz
align CMSG buffer
Diffstat (limited to 'src/ipv6nd.c')
-rw-r--r--src/ipv6nd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ipv6nd.c b/src/ipv6nd.c
index 1b048db9..f1f83d5f 100644
--- a/src/ipv6nd.c
+++ b/src/ipv6nd.c
@@ -1909,11 +1909,15 @@ ipv6nd_handledata(void *arg)
.iov_base = buf,
.iov_len = sizeof(buf),
};
- unsigned char ctl[CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int))] = { 0 };
+ union {
+ struct cmsghdr hdr;
+ uint8_t buf[CMSG_SPACE(sizeof(struct in6_pktinfo)) +
+ CMSG_SPACE(sizeof(int))];
+ } cmsgbuf = { .buf = { 0 } };
struct msghdr msg = {
.msg_name = &from, .msg_namelen = sizeof(from),
.msg_iov = &iov, .msg_iovlen = 1,
- .msg_control = ctl, .msg_controllen = sizeof(ctl),
+ .msg_control = cmsgbuf.buf, .msg_controllen = sizeof(cmsgbuf.buf),
};
ssize_t len;