diff options
| author | Roy Marples <roy@marples.name> | 2020-04-21 09:55:50 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-04-21 09:59:40 +0100 |
| commit | e14045cae2a4b66995a87bbc40c4516a00d4c087 (patch) | |
| tree | 2be9b4af1cb3e59f2aa66867d0dc319740ca9e7c /src/ipv6nd.c | |
| parent | 504992bdff47a6efeda0503022d333f7c0c63025 (diff) | |
| download | dhcpcd-e14045cae2a4b66995a87bbc40c4516a00d4c087.tar.xz | |
align CMSG buffer
Diffstat (limited to 'src/ipv6nd.c')
| -rw-r--r-- | src/ipv6nd.c | 8 |
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; |
