--- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -39,12 +39,14 @@ #include #include #include +#ifdef IPV6_SUPPORTED #if defined(__GLIBC__) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) /* Cannot safely include linux/in6.h in old glibc, so hardcode the needed values */ # define IPV6_PREFER_SRC_PUBLIC 2 # define IPV6_ADDR_PREFERENCES 72 #else # include +#endif #endif #include #include @@ -1123,6 +1125,7 @@ if (bind(sock, SAFE_SOCKADDR(&sin), sizeof(sin)) < 0) goto out; break; +#ifdef IPV6_SUPPORTED case AF_INET6: /* Make sure the call-back address is public/permanent */ val = IPV6_PREFER_SRC_PUBLIC; @@ -1130,6 +1133,7 @@ if (bind(sock, SAFE_SOCKADDR(&sin6), sizeof(sin6)) < 0) goto out; break; +#endif default: errno = EAFNOSUPPORT; goto out;