Re: [CFR] correct type of addrinfo.ai_addrlen and netent.n_net

From: Warner Losh <imp_at_bsdimp.com>
Date: Tue, 31 May 2005 14:03:34 -0600 (MDT)
> Warner Losh <imp_at_bsdimp.com> writes:
> > Dag-Erling Smørgrav <des_at_des.no> writes:
> > > What do we gain from removing the padding?  Is there even a single
> > > practical benefit to doing so?
> > It is for posix compatibility.
> 
> Nonsense.  POSIX does not forbid padding or additional structure
> members.  The exact wording is:
> 
> > The <netdb.h> header shall define the addrinfo structure that includes
> > at least the following members:
>   --------
> >
> > int               ai_flags      Input flags.
> > int               ai_family     Address family of socket.
> > int               ai_socktype   Socket type.
> > int               ai_protocol   Protocol of socket.
> > socklen_t         ai_addrlen    Length of socket address.
> > struct sockaddr  *ai_addr       Socket address of socket.
> > char             *ai_canonname  Canonical name of service location.
> > struct addrinfo  *ai_next       Pointer to next in list.

Did you bother reading what I posted?  I don't think so since you'd
have known that ai_addrlen was changed to be socklen_t for posix
compliance, and the padding was added for ABI compatibility.  The
removal of padding is the normal sort of thing that's done during
major revisions.  It was there, indirectly, for POSIX compliance.

Maybe the padding removal is too painful given all the extra 'oh, by
the ways' that we're stumbling over.

Warner
Received on Tue May 31 2005 - 18:05:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:35 UTC