CMSG_SPACE returns the aligned/padded size of the structure to be
transmitted and is used correctly for setting msg.msg_controllen,
but cmsghdr.cmsg_len is supposed to hold the actual length of the
payload, without any padding added for alignment, so that
the structure is unpacked correctly at the receiving side.
CMSG_SPACE returns the aligned/padded size of the structure to be transmitted and is used correctly for setting msg.msg_controllen, but cmsghdr.cmsg_len is supposed to hold the actual length of the payload, without any padding added for alignment, so that the structure is unpacked correctly at the receiving side.