This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/3] network: recvmsg and sendmsg standard compliance (BZ#16919)
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: <libc-alpha at sourceware dot org>
- Cc: <nd at arm dot com>
- Date: Thu, 7 Apr 2016 12:37:29 +0100
- Subject: Re: [PATCH 2/3] network: recvmsg and sendmsg standard compliance (BZ#16919)
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <1459175641-12520-1-git-send-email-adhemerval dot zanella at linaro dot org> <1459175641-12520-3-git-send-email-adhemerval dot zanella at linaro dot org> <57062EC6 dot 20504 at redhat dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 07/04/16 10:56, Florian Weimer wrote:
> On 03/28/2016 04:34 PM, Adhemerval Zanella wrote:
>> diff --git a/sysdeps/unix/sysv/linux/check_native.c b/sysdeps/unix/sysv/linux/check_native.c
>> index b3cbbe3..a8e447e 100644
>> --- a/sysdeps/unix/sysv/linux/check_native.c
>> +++ b/sysdeps/unix/sysv/linux/check_native.c
>> @@ -111,10 +111,13 @@ __check_native (uint32_t a1_index, int *a1_native,
>> {
>> struct msghdr msg =
>> {
>> - (void *) &nladdr, sizeof (nladdr),
>> - &iov, 1,
>> - NULL, 0,
>> - 0
>> + .msg_name = (void *) &nladdr,
>> + .msg_namelen = sizeof (nladdr),
>> + .msg_iov = &iov,
>> + .msg_iovlen = 1,
>> + .msg_control = NULL,
>> + .msg_controllen = 0,
>> + .msg_flags = 0
>> };
>
> The requirement for such changes always makes me nervous. If we have
> breakage in our own code, how many applications are affected?
>
yes, it looks risky.
> Note that the recvmsg manual page says “is defined as follows” about
> struct msghdr, not “contains the following members in some arbitrary order”.
>
i think the man page should be more clear about
that the msg_controllen, msg_iovlen and cmsg_len
types conflict with posix.
to prevent more non-portable code being written
based on the linux man page.
> Is standards compliance here really worth this risk?
>
> (I do not have a strong opinion either way, I just want to raise this
> point.)
>
> Florian
>