This is the mail archive of the glibc-bugs@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]

[Bug network/12377] getaddrinfo() should disregard link-local IPv6 addresses for AI_ADDRCONFIG purposes


http://sourceware.org/bugzilla/show_bug.cgi?id=12377

--- Comment #16 from Pavel Åimerda <psimerda at redhat dot com> 2012-07-31 13:16:43 UTC ---
> I am assuming that by Âthis option you mean AI_ADDRCONFIG?

Sure.

> If so, I disagree. 

Disagree with what exactly?

The way I see it, the primary reason for using AI_ADDRCONFIG
is to avoid making lookups from which any results cannot be used.

And it fails terribly, giving both false positives and false negatives
and even breaking literal IP addresses.

> words, if there is no IPv4 connectivity, avoid making "IN A" lookups.

This is exactly what AI_ADDRCONFIG doesn't do. It breaks various non-DNS
cases.

> If there is no IPv6 connectivity, avoid making "IN AAAA" lookups.

Same as above.

> Making useless lookups consume bandwidth/battery, and in the case of broken
> DNS server implementations

*None* of my objections was DNS-related. All were about either literal
addresses, /etc/hosts names or possible link-local NSS plugins.

That said, if bug 14413 was resolved, you could do this sort of black magic
entirely in nss-dns.so. Without it, it's really hard to implement a
working implementation of AI_ADDRCONFIG.

Maybe you could just specialcase DNS, it's a hack but certainly not worse
than what we're doing now.

> I don't think AI_ADDRCONFIG makes much sense when passing literal IP addresses
> to getaddrinfo(). It could probably be ignored in that case, I think. However,
> when passing hostnames to getaddrinfo() you can't do a routing test before
> doing the lookup(s), because the IP addresses aren't known at that point.

You unfortunately can't. But I couldn't know what is AI_ADDRCONFIG for if it's
not documented in the manual page. There's not a single word about DNS queries.

> That said, it is possible to connect to a global address from a link-local
> source address in one corner case. For example, say that your default router in
> the example above (fe80::23:45ff:fe67:8901) has 2001:db8:1:1::1 configured on
> its loopback interface. In that case, you could communicate with
> 2001:db8:1:1::1 from fe80::12:34ff:fe56:7890 without any problems.

Correct. You'd have to be a little bit more careful in assumptions even than
I am. But this also makes a cornercase for the current behavior. But even then
I have already spent like three days just testing this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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