From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Dickson Subject: [PATCH] nfsd: NFS fails to come up then the network is down. Date: Thu, 12 Nov 2009 14:23:22 -0500 Message-ID: <4AFC60AA.4030502@RedHat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 To: Linux NFS Mailing list Return-path: Received: from mx1.redhat.com ([209.132.183.28]:20264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbZKLTXS (ORCPT ); Thu, 12 Nov 2009 14:23:18 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nACJNNMw011816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 12 Nov 2009 14:23:23 -0500 Received: from badhat.bos.devel.redhat.com (vpn-227-194.phx2.redhat.com [10.3.227.194]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nACJNMHx010546 for ; Thu, 12 Nov 2009 14:23:23 -0500 Sender: linux-nfs-owner@vger.kernel.org List-ID: 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 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. Signed-off-by: Steve Dickson diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c index 12d3253..b8028bb 100644 --- a/utils/nfsd/nfssvc.c +++ b/utils/nfsd/nfssvc.c @@ -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;