From: Christoph Hellwig Subject: 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 Signed-off-by: Christoph Hellwig 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 && --