Date: Sat, 23 Jan 2016 22:33:03 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 206544] sendit "KPI" (in reality sendmsg(2); maybe sendto(2)) will fail with EINVAL if there's a mp->msg_control is not NULL and mp->msg_controllen is < sizeof(struct cmsghdr); is not documented in send(2) Message-ID: <bug-206544-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206544 Bug ID: 206544 Summary: sendit "KPI" (in reality sendmsg(2); maybe sendto(2)) will fail with EINVAL if there's a mp->msg_control is not NULL and mp->msg_controllen is < sizeof(struct cmsghdr); is not documented in send(2) Product: Base System Version: 9.3-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: ngie@FreeBSD.org 769 static int 770 sendit(td, s, mp, flags) 771 struct thread *td; 772 int s; 773 struct msghdr *mp; 774 int flags; 775 { ... 796 if (mp->msg_control) { 797 if (mp->msg_controllen < sizeof(struct cmsghdr) 798 #ifdef COMPAT_OLDSOCK 799 && mp->msg_flags !=3D MSG_COMPAT 800 #endif 801 ) { 802 error =3D EINVAL; 803 goto bad; 804 } The behavior on line 802 is not documented anywhere in send(2). It was driv= ing me nuts trying to figure out what was going on in tools/regression/unix_cmsg:t_cmsg_len because the test fails on amd64 becau= se that conditional is tripped -_-... --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-206544-8>