Bug 460561 - getaddrinfo() returns EAI_NONAME instead of EAI_AGAIN
Summary: getaddrinfo() returns EAI_NONAME instead of EAI_AGAIN
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 10
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-08-28 16:39 UTC by Miroslav Lichvar
Modified: 2009-10-28 15:54 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-10-28 15:54:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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?


Note You need to log in before you can comment on or make changes to this bug.