bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incomplete getaddrinfo module


From: Yoann Vandoorselaere
Subject: Re: Incomplete getaddrinfo module
Date: Thu, 15 Sep 2005 17:58:22 +0200

On Thu, 2005-09-15 at 17:36 +0200, Simon Josefsson wrote:
> Yoann Vandoorselaere <address@hidden> writes:
> 
> > If  the  AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
> > returned only if an IPv4 address is configured on the local system, and
> > IPv6 addresses shall be returned only if an IPv6 address is configured
> > on the local system.
> 
> This looks tricky to implement.  Looking at libc code, it uses
> getifaddrs, which appear tricky to implement portably.  But we could
> support multiple implementations of getifaddrs, one for each system
> where we know how to implement it.  I don't see how we could hope to
> do better.

In the meantime, a good workaround would be to remove the definition for
AI_ADDRCONFIG from GnuLib provided getaddrinfo.h. This way, application
can test for the flag and avoid to use it if it is not present.

Libprelude for example won't use AI_ADDRCONFIG in case the header does
not export it because this is known to not be portable. However, since
GnuLib export the flags, it get used, and getaddrinfo() will fails due
to the usage of unsupported flags.

> > If the AI_PASSIVE flag is specified, the returned address information
> > shall be suitable for use in binding  a  socket  for  accepting incoming
> > connections  for  the specified service. In this case, if the nodename
> > argument is null, then the IP address portion of the socket address
> > structure shall be set to INADDR_ANY for an IPv4 address or
> > IN6ADDR_ANY_INIT for an IPv6 address.  (...)
> 
> I don't think this would be that difficult to implement.

Yes, it should be pretty easy.


-- 
Yoann Vandoorselaere <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]