summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-10-28 12:12:12 -0400
committerSteve Dickson <steved@redhat.com>2010-11-01 08:05:14 -0400
commit1ea2c3be33f2eb4630c5cdb78edf2bb670b294ab (patch)
tree37422ba858cffebe289604c67c83ac8fb5047ff7 /support
parentf8e315543b7f1db7f37a4bfe8ede3020cef62868 (diff)
downloadnfs-utils-1ea2c3be33f2eb4630c5cdb78edf2bb670b294ab.tar.gz
nfs-utils-1ea2c3be33f2eb4630c5cdb78edf2bb670b294ab.tar.xz
nfs-utils-1ea2c3be33f2eb4630c5cdb78edf2bb670b294ab.zip
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 <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
-rw-r--r--support/export/hostname.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/support/export/hostname.c b/support/export/hostname.c
index 3c55ce7..efcb75c 100644
--- a/support/export/hostname.c
+++ b/support/export/hostname.c
@@ -30,10 +30,6 @@
#include "sockaddr.h"
#include "exportfs.h"
-#ifndef HAVE_DECL_AI_ADDRCONFIG
-#define AI_ADDRCONFIG 0
-#endif
-
/**
* host_ntop - generate presentation address given a sockaddr
* @sap: pointer to socket address
@@ -170,7 +166,7 @@ host_addrinfo(const char *hostname)
#endif
/* don't return duplicates */
.ai_protocol = (int)IPPROTO_UDP,
- .ai_flags = AI_ADDRCONFIG | AI_CANONNAME,
+ .ai_flags = AI_CANONNAME,
};
int error;