Sync style with the existing _packed & _unused macros
[project/odhcp6c.git] / src / ra.c
index dd5962a29e750dba87bd39c33664e8e531efc7d5..89dc58b960b557b3e3a6d651b11b1a6a5fa49c7c 100644 (file)
--- a/src/ra.c
+++ b/src/ra.c
@@ -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
                };