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

Bug#780294: Attempts to resolve IPv6 even when only link-local IPv6 addresses configured



On Wed, Mar 11, 2015 at 10:59:40AM -0700, Josh Triplett wrote:
> Package: libc6
> Version: 2.19-15
> Severity: important
> 
> I'm on a network that has somewhat broken DNS: attempts to resolve AAAA
> records for some hosts produce long timeouts.
> 
> As I understand it, glibc is supposed to check whether the system has
> any non-link-local IPv6 addresses configured, and only attempt to
> resolve DNS requests to IPv6 addresses (via AAAA queries) if so.

I think this is a wrong understanding. The only function that I'm aware
to do something like that is getaddrinfo(3). If an application is still on
the older interface (gethostbyname(3) et al.) ipv6 stuff cannot be
suppressed AFAIK.

For getaddrinfo(3) this is only done when AI_ADDRCONF is passed in
hints->ai_flags.

You can easily see the differences using python:

	>>> import socket
	>>> def addrinfo(*args, **kwargs):
	...   for a in socket.getaddrinfo(*args, **kwargs):
	...     print(a)
	...
	>>> addrinfo("www.debian.org", "https", flags=socket.AI_ADDRCONFIG)
	...
	>>> addrinfo("www.debian.org", "https", flags=0)
	...

(Note however that python's getaddrinfo has a different default when no
flags are given than glibc's getaddrinfo.)

I don't have access to an ipv4 only host with ipv6 ll addresses, but
maybe adding some more info here (Output of

	ip a
	ip -6 a

and the output of the above python sniplet) would be helpful.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature


Reply to: