Bug 460561

Summary: getaddrinfo() returns EAI_NONAME instead of EAI_AGAIN
Product: [Fedora] Fedora Reporter: Miroslav Lichvar <mlichvar>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: atkac, drepper, eric-bugs, jakub, lex.lists, mads, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-28 15:54:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Lichvar 2008-08-28 16:39:08 UTC
Description of problem:
In default configuration, when resolv.conf is empty, getaddrinfo() returns EAI_NONAME instead of EAI_AGAIN (as it used to in F9).

This makes ntpd useless when NetworkManager is enabled, because ntpd won't try to resolve the name later when NM has setup resolv.conf.


Version-Release number of selected component (if applicable):
glibc-2.8.90-11

How reproducible:
Always

Steps to Reproduce:
1. > /etc/resolv.conf
2. gcc -x c - <<EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include <stdio.h>

int main() {
	struct addrinfo hints, *addr;

	memset(&hints, 0, sizeof(hints));
	hints.ai_family = AF_UNSPEC;

	printf("%d\n", getaddrinfo("0.fedora.pool.ntp.org", NULL, &hints, &addr));
	return 0;
}
EOF
3. ./a.out
  
Actual results:
-2

Expected results:
-3

Additional info:

Comment 1 Miroslav Lichvar 2008-10-06 10:24:47 UTC
Any chance this will be resolved in F10? I can put a workaround to ntpd if necessary, but ntpd in default installation with default config doesn't work now.

Comment 2 Mads Kiilerich 2008-11-13 19:09:09 UTC
I have created Bug 471450 which might be related

Comment 3 Bug Zapper 2008-11-26 02:53:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Tim Waugh 2008-11-27 10:02:57 UTC
Also related: cups-polld fails to resolve hostnames, even though it calls res_init() if it gets EAI_FAIL from getaddrinfo().  This is because getaddrinfo() is caching EAI_NONAME results.

Comment 5 Ulrich Drepper 2008-12-03 07:12:21 UTC
I've changed the upstream glibc code.

Comment 6 lexual 2009-03-04 01:04:02 UTC
Has this upstream code hit f9, f10, rawhide yet?