Fix cmsg(3) API usage on OpenBSD

msg_controllen should be set using CMSG_SPACE() to account for padding.
RFC3542 provides more details:

  While sending an application may or may not include padding at the end
  of last ancillary data in msg_controllen and implementations must
  accept both as valid.

At least OpenBSD rejects control messages if msg_controllen doesn't
account for padding, so use CMSG_SPACE() for maximal portability.  This
is consistent with the example provided in the Linux cmsg(3) manpage.
1 file changed