changeset 2896:735e5c9ce3b6 draft

Attempt to define CMSG_SPACE for systems which lack it, like QNX.
author Roy Marples <roy@marples.name>
date Sat, 20 Dec 2014 11:56:27 +0000
parents 45097b201e22
children 9d2438c982d2
files ipv6.h
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ipv6.h	Fri Dec 19 10:45:45 2014 +0000
+++ b/ipv6.h	Sat Dec 20 11:56:27 2014 +0000
@@ -143,6 +143,16 @@
 #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)))