From 1ea2c3be33f2eb4630c5cdb78edf2bb670b294ab Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Thu, 28 Oct 2010 12:12:12 -0400 Subject: nfs-utils: Remove all uses of AI_ADDRCONFIG It was reported that, if only "lo" is up, mount.nfs 127.0.0.1:/export /mount fails with "Name or service not known". "man 3 getaddrinfo" says this: 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 man page oversimplifies here. A review of glibc shows that getaddrinfo(3) explicitly ignores loopback addresses when deciding whether an IPv4 or IPv6 address is configured. This behavior around loopback is a problem not just for mount.nfs, but also for RPC daemons that have to start up before a system's networking is fully configured and started. Given the history of other problems with AI_ADDRCONFIG and the unpredictable behavior it introduces, let's just remove it everywhere in nfs-utils. This fix addresses: https://bugzilla.linux-nfs.org/show_bug.cgi?id=191 Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- utils/statd/hostname.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'utils/statd/hostname.c') diff --git a/utils/statd/hostname.c b/utils/statd/hostname.c index 38f2265..616a3cb 100644 --- a/utils/statd/hostname.c +++ b/utils/statd/hostname.c @@ -39,10 +39,6 @@ #include "statd.h" #include "xlog.h" -#ifndef HAVE_DECL_AI_ADDRCONFIG -#define AI_ADDRCONFIG 0 -#endif - /** * statd_present_address - convert sockaddr to presentation address * @sap: pointer to socket address to convert -- cgit