Skip to contentSkip to conversation

nfsd: NFS fails to come up then the network is down.

PATCH In review Steve Dickson 2 participants 3 messages Nov 12, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: NFS fails to come up then the network is down.

In some recent testing it appears nfsd fails to come up when an non-loopback network interface is not configured. This patch solves the problem.

steved.

commit 2905358524c0835311501bad04c521479b0525ff

Author: Steve Dickson <[email protected]>
Date:   Thu Nov 12 14:16:12 2009 -0500

Remove the AI_ADDRCONFIG hint flag to getaddrinfo() when it's call by nfsd to set up the file descriptors that are sent to the kernel. The flag causes the getaddrinfo() to fail, with EAI_NONAME, when there is not a non-loopback network interface configured.

utils/nfsd/nfssvc.c +1 -1
index 12d3253..b8028bb 100644
@@ -212,7 +212,7 @@ int
 nfssvc_set_sockets(const int family, const unsigned int protobits,
 		   const char *host, const char *port)
 {
-	struct addrinfo hints = { .ai_flags = AI_PASSIVE | AI_ADDRCONFIG };
+	struct addrinfo hints = { .ai_flags = AI_PASSIVE };
 
 	hints.ai_family = family;
 

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#2 lore raw
Quoted 23 lines · On Thu, 12 Nov 2009 14:23:22 -0500 Steve Dickson <[email protected]> wrote:

In some recent testing it appears nfsd fails to come up when an non-loopback network interface is not configured. This patch solves the problem.

steved.

commit 2905358524c0835311501bad04c521479b0525ff

Author: Steve Dickson <[email protected]>
Date:   Thu Nov 12 14:16:12 2009 -0500

Remove the AI_ADDRCONFIG hint flag to getaddrinfo() when it's call by nfsd to set up the file descriptors that are sent to the kernel. The flag causes the getaddrinfo() to fail, with EAI_NONAME, when there is not a non-loopback network interface configured.

utils/nfsd/nfssvc.c +0 -0
index 12d3253..b8028bb 100644

utils/nfsd/nfssvc.c int · line 218

Quoted 8 lines
utils/nfsd/nfssvc.c +1 -1
@@ -212,7 +212,7 @@ int
 nfssvc_set_sockets(const int family, const unsigned int protobits,
 		   const char *host, const char *port)
 {
-	struct addrinfo hints = { .ai_flags = AI_PASSIVE | AI_ADDRCONFIG };
+	struct addrinfo hints = { .ai_flags = AI_PASSIVE };
 
 	hints.ai_family = family;
 

Patch looks correct. I think AI_ADDRCONFIG is superfluous here. nfsd already limits what sockets it tries to hand off to the kernel based on the contents of /etc/netconfig so there should be no problem removing that flag.

#3 lore raw
In reply to a message not in the archive
Quoted 23 lines · Steve Dickson

In some recent testing it appears nfsd fails to come up when an non-loopback network interface is not configured. This patch solves the problem.

steved.

commit 2905358524c0835311501bad04c521479b0525ff

Author: Steve Dickson <[email protected]>
Date:   Thu Nov 12 14:16:12 2009 -0500

Remove the AI_ADDRCONFIG hint flag to getaddrinfo() when it's call by nfsd to set up the file descriptors that are sent to the kernel. The flag causes the getaddrinfo() to fail, with EAI_NONAME, when there is not a non-loopback network interface configured.

utils/nfsd/nfssvc.c +0 -0
index 12d3253..b8028bb 100644

utils/nfsd/nfssvc.c int · line 218

Quoted 8 lines
utils/nfsd/nfssvc.c +1 -1
@@ -212,7 +212,7 @@ int
 nfssvc_set_sockets(const int family, const unsigned int protobits,
 		   const char *host, const char *port)
 {
-	struct addrinfo hints = { .ai_flags = AI_PASSIVE | AI_ADDRCONFIG };
+	struct addrinfo hints = { .ai_flags = AI_PASSIVE };
 
 	hints.ai_family = family;
 

Committed...

steved.