Re: [evolution-patches] [PATCH] Only use ipv6 address if ipv6 interface is available



On Fri, 2003-10-17 at 16:17, Dan Winship wrote:
> On Fri, 2003-10-17 at 15:50, Jeremy Katz wrote:
> > Based on comments from Ulrich -- when using IPv6, you want to use the
> > AI_ADDRCONFIG flag in the hints argument to getaddrinfo() to avoid
> > connecting to an IPv6 address if you don't have an IPv6 interface
> > configured. 
> 
> What is the purpose of the additional call to getaddrinfo without
> AI_ADDRCONFIG? It seems like if the first call fails, the second call
> would either also fail or would return an address that was guaranteed to
> be unusable.

The system you build on may have AI_ADDRCONFIG defined in its headers,
but you could be running on a system that doesn't have the runtime
support.  In that case, the getaddrinfo() call will return EAI_BAD_FLAGS
and you should try again without the AI_ADDRCONFIG.  Yes, you could get
back an address that's unusable, but then again, it could be a perfectly
usable address (it's basically the same as before -- you'll get the IPv6
address, there's just no way to know if you can use it)

Jeremy




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