diff options
author | Christoph Hellwig <hch@lst.de> | 2015-10-30 09:18:21 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-10-30 09:18:21 -0400 |
commit | c31fef7f4beb736f6cfe29a2de6d769c7c1e780d (patch) | |
tree | 343cef72d08a68899a6af757a1e42dc256677792 | |
parent | 71ce07f2c87c450cbc3ca233c520584b897c4761 (diff) | |
download | nfs-utils-c31fef7f4beb736f6cfe29a2de6d769c7c1e780d.tar.gz nfs-utils-c31fef7f4beb736f6cfe29a2de6d769c7c1e780d.tar.xz nfs-utils-c31fef7f4beb736f6cfe29a2de6d769c7c1e780d.zip |
nfsd: ignore unsupported address types in nfssvc_setfds
Just continue and try a different record returned from getaddrinfo
if the kernel does not support an address family. This fixes nfsd
startup on kernels without IPv6 support.
Suggested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/nfsd/nfssvc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c index a2b11d8..fc11d23 100644 --- a/utils/nfsd/nfssvc.c +++ b/utils/nfsd/nfssvc.c @@ -174,15 +174,14 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) sockfd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); if (sockfd < 0) { - if (errno == EAFNOSUPPORT) - xlog(L_NOTICE, "address family %s not " - "supported by protocol %s", - family, proto); - else + if (errno != EAFNOSUPPORT) { xlog(L_ERROR, "unable to create %s %s socket: " "errno %d (%m)", family, proto, errno); - rc = errno; - goto error; + rc = errno; + goto error; + } + addr = addr->ai_next; + continue; } #ifdef IPV6_SUPPORTED if (addr->ai_family == AF_INET6 && |