Move the size_t cast inside the comparison so the result of CMSG_FIRSTHDR is a pointer to the first header
Note about protection of CMSG_NXTHDR