summaryrefslogtreecommitdiffstats
path: root/src/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-26 21:05:06 +0100
committerRoy Marples <roy@marples.name>2020-04-26 21:05:06 +0100
commit29024d0ba64010eb85ad0d164898b7751d47d1cb (patch)
treeffb90913287a48c1610eb1d7096f3d9246e16a8a /src/ipv6nd.c
parent62094f1bd162e2a4cbaf21409c73904c6524927c (diff)
downloaddhcpcd-29024d0ba64010eb85ad0d164898b7751d47d1cb.tar.xz
Align more CMSG foo.
Diffstat (limited to 'src/ipv6nd.c')
-rw-r--r--src/ipv6nd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ipv6nd.c b/src/ipv6nd.c
index faf31561..99e92aaf 100644
--- a/src/ipv6nd.c
+++ b/src/ipv6nd.c
@@ -328,11 +328,14 @@ ipv6nd_sendrsprobe(void *arg)
.sin6_scope_id = ifp->index,
};
struct iovec iov = { .iov_base = state->rs, .iov_len = state->rslen };
- unsigned char ctl[CMSG_SPACE(sizeof(struct in6_pktinfo))] = { 0 };
+ union {
+ struct cmsghdr hdr;
+ uint8_t buf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
+ } cmsgbuf = { .buf = { 0 } };
struct msghdr msg = {
.msg_name = &dst, .msg_namelen = sizeof(dst),
.msg_iov = &iov, .msg_iovlen = 1,
- .msg_control = ctl, .msg_controllen = sizeof(ctl),
+ .msg_control = cmsgbuf.buf, .msg_controllen = sizeof(cmsgbuf.buf),
};
struct cmsghdr *cm;
struct in6_pktinfo pi = { .ipi6_ifindex = ifp->index };
@@ -402,11 +405,14 @@ ipv6nd_sendadvertisement(void *arg)
.sin6_scope_id = ifp->index,
};
struct iovec iov = { .iov_base = ia->na, .iov_len = ia->na_len };
- unsigned char ctl[CMSG_SPACE(sizeof(struct in6_pktinfo))] = { 0 };
+ union {
+ struct cmsghdr hdr;
+ uint8_t buf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
+ } cmsgbuf = { .buf = { 0 } };
struct msghdr msg = {
.msg_name = &dst, .msg_namelen = sizeof(dst),
.msg_iov = &iov, .msg_iovlen = 1,
- .msg_control = ctl, .msg_controllen = sizeof(ctl),
+ .msg_control = cmsgbuf.buf, .msg_controllen = sizeof(cmsgbuf.buf),
};
struct cmsghdr *cm;
struct in6_pktinfo pi = { .ipi6_ifindex = ifp->index };