]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Attempt to define CMSG_SPACE for systems which lack it, like QNX.
authorRoy Marples <roy@marples.name>
Sat, 20 Dec 2014 11:56:27 +0000 (11:56 +0000)
committerRoy Marples <roy@marples.name>
Sat, 20 Dec 2014 11:56:27 +0000 (11:56 +0000)
ipv6.h

diff --git a/ipv6.h b/ipv6.h
index 41074c725aa243581c899b0f1281bddb0b29f37a..ec4102c8adf3e962f39bdf175ca104fd898f6833 100644 (file)
--- a/ipv6.h
+++ b/ipv6.h
@@ -143,6 +143,16 @@ struct ipv6_state {
 #define IPV6_CSTATE(ifp)                                                      \
        ((const struct ipv6_state *)(ifp)->if_data[IF_DATA_IPV6])
 
+#ifndef ALIGNBYTES
+#define ALIGNBYTES (sizeof(int) - 1)
+#endif
+#ifndef ALIGN
+#define        ALIGN(p) (((unsigned int)(p) + ALIGNBYTES) & ~ALIGNBYTES)
+#endif
+#ifndef CMSG_SPACE
+#define        CMSG_SPACE(len) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(len))
+#endif
+
 #define IP6BUFLEN      (CMSG_SPACE(sizeof(struct in6_pktinfo)) + \
                        CMSG_SPACE(sizeof(int)))