|
Bugzilla – Full Text Bug Listing |
| Summary: | unscd breaks ipv6 name lookups | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 12.2 | Reporter: | Dominique Leuenberger <dimstar> |
| Component: | Basesystem | Assignee: | Michael Matz <matz> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Critical | ||
| Priority: | P5 - None | CC: | aj, bwiedemann, crrodriguez, ismail, matz |
| Version: | Factory | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Bug Depends on: | 684534 | ||
| Bug Blocks: | |||
| Attachments: | Possible patch | ||
|
Description
Dominique Leuenberger
2012-06-14 16:45:08 UTC
Saw this one, workaround, install glibc nscd , package "nscd" AJ, I found that this fixes the problem:
--- nscd-0.48.c (revision 1)
+++ nscd-0.48.c (working copy)
@@ -1084,7 +1084,7 @@
unsigned canonlen = 0;
memset(&hints, 0, sizeof(hints));
- hints.ai_flags = AI_CANONNAME;
+ hints.ai_flags = (AI_CANONNAME | AI_ADDRCONFIG);
/* kills dups (one for each possible SOCK_xxx) */
/* this matches glibc behavior */
hints.ai_socktype = SOCK_STREAM;
but reading
man 3 getaddrinfo
makes me think, that this is actually a glibc bug:
If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4 addresses
are returned in the list pointed to by res only if the local system has
at least one IPv4 address configured, and IPv6 addresses are only
returned if the local system has at least one IPv6 address configured.
The loopback address is not considered for this case as valid as a con-
figured address.
if you want to try:
https://build.opensuse.org/package/show?package=unscd&project=home%3Abmwiedemann%3Abranches%3ABase%3ASystem
the breakage comes from getaddrinfo-ipv6-sanity.diff having glibc/sysdeps/posix/getaddrinfo.c - last_i = gaih_inet (name, pservice, hints, end, &naddrs); + last_i = gaih_inet (name, pservice, hints, end, &naddrs, seen_ipv6); where seen_ipv6 is not initialized by the above __check_pf call (because it is within the if(hints->ai_flags & AI_ADDRCONFIG) ) and not yet by the below __check_pf call changes from bug 684534 may have introduced some of it Yeah, possibly we can check the local addresses also for !AI_ADDRCONFIG. Note: for glibc 2.11 check_pf is still called unconditional, so the same should also be done for newer glibc, at _for us_, as we use seen_ipv6 also unconditional. Michael, do you have an updated patch? Created attachment 497405 [details]
Possible patch
I think this should do the trick. It replaces the whole old getaddrinfo-ipv6-sanity.diff patch. It applies to some git glibc I had lying
around, it probably also applies to 2.15.
Thanks, adding to our glibc now. Bernhard, Dominique, Base:System has a new glibc (awaiting Factory review). Could you test that one, please? With the glibc*.rpm packages from Base:System and unscd running, I can still ping ipv6 addresses... so that looks good. glibc+unscd now returns AAAA records when I have any IPv6 addr, even a link-local addr that can not be used for accessing the internet. So the patch only prevents IPv6-lookups when people disable IPv6 completely. That is fine for me. Closing this one as fixed since comment #12 and comment #13 confirms. |