The check for `msg->msg_controllen > 0` is not necessary, as I understand -- it is included in `CMSG_FIRSTHDR` .  In fact, it's a more complete check in there, anyway: that `msg_controllen` is not just non-zero, but long enough to contain a valid `struct cmsghdr`.