This isn't the most elegant fix, but it's a fiddly issue. I may revisit this again later if I think of a cleaner way to handle it.
On some 64-bit platforms, due to struct alignment requirements, the smallest cmsghdr has capacity for 2 fds even if only 1 is expected/requested. Due to buffer coalescing, multiple sendmsg calls may arrive via a single recvmsg, resulting in a situation where the cmsghdr contains multiple (maximum 2) fds.
This isn't the most elegant fix, but it's a fiddly issue. I may revisit this again later if I think of a cleaner way to handle it.
On some 64-bit platforms, due to struct alignment requirements, the smallest
cmsghdr
has capacity for 2 fds even if only 1 is expected/requested. Due to buffer coalescing, multiplesendmsg
calls may arrive via a singlerecvmsg
, resulting in a situation where thecmsghdr
contains multiple (maximum 2) fds.This addresses BMO 1750345.