Control: tags -1 + moreinfo Hi,
On Tue, Aug 04, 2020 at 08:59:42PM +0200, Thorsten Glaser wrote: > On Mon, 3 Aug 2020, Thorsten Glaser wrote: > > > keep the code I currently have that compares byte 0 and 3, using > > Actually not. I’ve added some debugging code with… > > static size_t > cmsg_actual_data_len(const struct cmsghdr *cmsg) > { > union { > const struct cmsghdr *cmsg; > const unsigned char *uc; > } ptr[( > /* compile-time assertions */ > sizeof(socklen_t) <= sizeof(size_t) > ) ? 1 : -1]; > ptrdiff_t pd; > > ptr[0].cmsg = cmsg; > pd = CMSG_DATA(cmsg) - ptr[0].uc; > return ((size_t)cmsg->cmsg_len - (size_t)pd); > } > > … and dumping the received data on Linux and MidnightBSD > (the two systems I currently have access) and found varying > results but if this returns 4 I think I better consume an int. I see it was forwarded back then to https://lore.kernel.org/netdev/e67190b7de22fff20fb4c5c084307e0b76001248.ca...@decadent.org.uk/ but there was no comment from netdev people. Should this bug be closed? Regards, Salvatore