summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2017-10-02 10:04:41 -0400
committerSteve Dickson <steved@redhat.com>2017-10-05 10:49:32 -0400
commit9176fa77355d93d1b520b95a1e1940f1c3e74d57 (patch)
treef7f96f4a63609f84df5a8d6c516db635860ada7a
parent1d7e3a4808e1b8514af6342c1b49aaf08825b08f (diff)
downloadnfs-utils-9176fa77355d93d1b520b95a1e1940f1c3e74d57.tar.gz
nfs-utils-9176fa77355d93d1b520b95a1e1940f1c3e74d57.tar.xz
nfs-utils-9176fa77355d93d1b520b95a1e1940f1c3e74d57.zip
rpc.nfsd: Do not fail when all address families are not support.
Commit 2f8a6020 introduce a regression causing rpc.nfsd to fail when IPv6 is not supported. rpc.nfsd should not fail when there is at least one bounded socket. Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/nfsd/nfssvc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
index e8609c1..fc36792 100644
--- a/utils/nfsd/nfssvc.c
+++ b/utils/nfsd/nfssvc.c
@@ -112,7 +112,7 @@ static int
nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
{
int fd, on = 1, fac = L_ERROR;
- int sockfd = -1, rc = 0;
+ int sockfd = -1, rc = 0, bounded = 0;
struct addrinfo *addrhead = NULL, *addr;
char *proto, *family;
@@ -233,6 +233,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
rc = errno;
goto error;
}
+ bounded++;
+
close(fd);
close(sockfd);
sockfd = fd = -1;
@@ -245,7 +247,7 @@ error:
close(sockfd);
if (addrhead)
freeaddrinfo(addrhead);
- return rc;
+ return (bounded ? 0 : rc);
}
int