Summary: | nss/tst-nss-files-hosts-long fails when no interface has AF_INET6 address (ie docker) | ||
---|---|---|---|
Product: | glibc | Reporter: | Romain Geissler <romain.geissler> |
Component: | nss | Assignee: | Florian Weimer <fweimer> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fantasquex, fweimer, xry111 |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.30 | ||
Target Milestone: | 2.37 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2022-09-13 00:00:00 |
Description
Romain Geissler
2019-07-17 12:31:19 UTC
FYI, I tested this against my own nss/tst-nss-files-hosts-long failure, and your patch does NOT fix that. It would have been to easy. 8-( But it looks this is a step in the right direction. Would you please post the patch to the mailing list? Thanks. (In reply to Florian Weimer from comment #1) > FYI, I tested this against my own nss/tst-nss-files-hosts-long failure, and > your patch does NOT fix that. It would have been to easy. 8-( I think the patch also need to check if ifa_addr is loopback. getent sets AI_ADDRCONFIG so if the local system only has loopback addresses, it won't work. I met this issue as well when building glibc v2.35 on ArchLinux RISC-V. The situation is just like the one described by Xi Ruoyao. The kernel of the board enables IPv6. There is only a loop back address in my system, no link local address. When debuging using gdb, I noticed getent() failed because getaddrinfo() returned EAI_NONAME. I've got a different patch that adds an option to getent to disable AI_ADDRCONFIG. Patches posted: [PATCH 0/2] Fix nss/tst-nss-files-hosts-long on single-stack hosts (bug 24816) <https://sourceware.org/pipermail/libc-alpha/2022-September/141958.html> Fixed for 2.37 via: commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00 Author: Florian Weimer <fweimer@redhat.com> Date: Tue Sep 13 16:11:40 2022 +0200 nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816) getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default. Use --no-addrconfig to suppress that, so that both IPv4 and IPv6 lookups succeed even if the address family is not supported by the host. Reviewed-by: Carlos O'Donell <carlos@redhat.com> commit a623f13adfac47c8634a7288e08f821a846bc650 Author: Florian Weimer <fweimer@redhat.com> Date: Tue Sep 13 16:10:20 2022 +0200 nss: Implement --no-addrconfig option for getent The ahosts, ahostsv4, ahostsv6 commands unconditionally pass AI_ADDRCONFIG to getaddrinfo, which is not always desired. Reviewed-by: Carlos O'Donell <carlos@redhat.com> I do not plan to backport this. Please advise if you need a backport to some branches. Hi, From what I see, you backported this at least to branch 2.36, in commits 700d3281f9e57b53c27bc991394b22d467432626 and 2681d38cafaceafeb330bc0536fa710b75ed5947, thanks ! Cheers, Romain Indeed, I think I backported this all the way to 2.34. |