From: Roy Marples Date: Sat, 20 Dec 2014 11:56:27 +0000 (+0000) Subject: Attempt to define CMSG_SPACE for systems which lack it, like QNX. X-Git-Tag: v6.7.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84da000ec5331f14985a778fde4c1f3746660466;p=thirdparty%2Fdhcpcd.git Attempt to define CMSG_SPACE for systems which lack it, like QNX. --- diff --git a/ipv6.h b/ipv6.h index 41074c72..ec4102c8 100644 --- 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)))