This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] network: recvmsg and sendmsg standard compliance (BZ#16919)


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?

Note that the recvmsg manual page says “is defined as follows” about
struct msghdr, not “contains the following members in some arbitrary order”.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]