|
Message-ID: <a9e8f609-0172-6d7b-eced-b70bec2ee7d8@dd-wrt.com> Date: Thu, 7 Apr 2016 13:42:17 +0200 From: Sebastian Gottschall <s.gottschall@...wrt.com> To: musl@...ts.openwall.com Subject: Re: recvmsg/sendmsg broken on mips64 > ok so the failure is in sendmsg and in the msg_control copy. > > does the call fail with ENOMEM (because >1024 bytes of ancillary data)? > that would be easy to fix.. > > (libc has to make a copy, the struct is const and might be in > readonly memory. a detailed bug report of the failure would > be more useful than speculations about broken compilers.. > e.g. strace log with and without the msg_control copying.) how to make a more detailed report than just that all netlink operations in iproute2 fail. so the whole ip command doesnt work. i tracked it down to recvmsg / sendmsg which do not return in success for some reason. if i send it more detailed, which means i debug out the real cause would also mean submit a better patch. just had no time yet to care about since my hack works. but does not fit to your philosophy. its easy to reproduce on any octeon device using musl and iproute2. > >> #if LONG_MAX > INT_MAX >> struct msghdr h; >> struct cmsghdr chbuf[1024/sizeof(struct cmsghdr)+1], *c; >> if (msg) { >> h = *msg; >> h.__pad1 = h.__pad2 = 0; >> msg = &h; >> if (h.msg_controllen) { >> if (h.msg_controllen > 1024) { >> errno = ENOMEM; >> return -1; >> } >> memcpy(chbuf, h.msg_control, h.msg_controllen); >> h.msg_control = chbuf; >> for (c=CMSG_FIRSTHDR(&h); c; c=CMSG_NXTHDR(&h,c)) >> c->__pad1 = 0; >> } >> } >> #endif
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.