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: [RFC PATCH 2/2] getaddrinfo: Add AF_VSOCK support


On 09/29/2016 12:27 PM, Stefan Hajnoczi wrote:
+  ai = *pai = malloc (sizeof (struct addrinfo) + sizeof (struct sockaddr_vm));

You should define a local struct type for this, to make it more obvious that you got the alignment correct.

> +  ai->ai_addr = (void *) (ai + 1);

Then you can avoid this pointer arithmetic as well.

If we decide to add this functionality, we'll need tests for it.

Florian


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