swrap: Simplify cmspace calculation in swrap_sendmsg_copy_cmsg()
authorRalph Boehme <slow@samba.org>
Thu, 8 Oct 2015 01:25:53 +0000 (03:25 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 14 Oct 2015 09:29:34 +0000 (11:29 +0200)
commitf3489d5cb77a804891bdaff3d90449fa7f293dd6
tree6ce5d1baf9689ff4b1e140485df650faab71db07
parentc5e809fed9a9e2cfce40312150322f28d3d338a6
swrap: Simplify cmspace calculation in swrap_sendmsg_copy_cmsg()

With cmsg->cmsg_len = CMSG_LEN(len) =>

CMSG_ALIGN(cmsg->cmsg_len) =

CMSG_ALIGN(CMSG_LEN(len)) =

CMSG_ALIGN(CMSG_ALIGN(sizeof(struct cmsghdr)) + len) =

CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len) =

CMSG_SPACE(len) =

CMSG_SPACE(CMSG_ALIGN(sizeof(struct cmsghdr)) + len - CMSG_ALIGN(sizeof(struct cmsghdr))) =

CMSG_SPACE(CMSG_LEN(len) - CMSG_ALIGN(sizeof(struct cmsghdr))) =

CMSG_SPACE(cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)))

:)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/socket_wrapper.c