diff options
author | Steven Barth <steven@midlink.org> | 2016-02-08 08:02:31 +0100 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2016-02-08 08:02:31 +0100 |
commit | 7533a6243dc3ac5a747cf6ccbc4d0539dafd3e07 (patch) | |
tree | 71a6f9de328b89856ba0b58a8cfcca210c871798 /src/ra.c | |
parent | ec7f4701b348f5c4c3191ca83ecd8453c431c432 (diff) | |
parent | 7a3af454310e5cd8cded240aac4a1e2a7fd04569 (diff) | |
download | odhcp6c-7533a6243dc3ac5a747cf6ccbc4d0539dafd3e07.tar.gz |
Alignment cleanups
Diffstat (limited to 'src/ra.c')
-rw-r--r-- | src/ra.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -274,8 +274,11 @@ bool ra_process(void) { bool found = false; bool changed = false; - uint8_t buf[1500] __aligned(4); - uint8_t cmsg_buf[128] __aligned(__alignof__(struct cmsghdr)); + uint8_t buf[1500] _aligned(4); + union { + struct cmsghdr hdr; + uint8_t buf[CMSG_SPACE(sizeof(int))]; + } cmsg_buf; struct nd_router_advert *adv = (struct nd_router_advert*)buf; struct odhcp6c_entry *entry = alloca(sizeof(*entry) + 256); const struct in6_addr any = IN6ADDR_ANY_INIT; @@ -302,7 +305,7 @@ bool ra_process(void) .msg_namelen = sizeof(from), .msg_iov = &iov, .msg_iovlen = 1, - .msg_control = cmsg_buf, + .msg_control = cmsg_buf.buf, .msg_controllen = sizeof(cmsg_buf), .msg_flags = 0 }; |