From 268af26359c8f1c87585e26d2763e3a3a63f8714 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 11 Sep 2015 09:47:27 -0700 Subject: [PATCH] CMSG_DATA should return an unsigned char*. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html > CMSG_DATA(cmsg) > If the argument is a pointer to a cmsghdr structure, this macro > shall return an unsigned character pointer to the data array > associated with the cmsghdr structure. Change-Id: I3f89ba19cbca4e6727abc65a2bbcd59267892ba8 --- libc/include/sys/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h index 43d15865f..ff8a815df 100644 --- a/libc/include/sys/socket.h +++ b/libc/include/sys/socket.h @@ -109,7 +109,7 @@ struct cmsghdr { #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr((mhdr), (cmsg)) #define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) -#define CMSG_DATA(cmsg) ((void*)((char*)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr)))) +#define CMSG_DATA(cmsg) (((unsigned char*)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr)))) #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len)) #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) #define CMSG_FIRSTHDR(msg) \