Message ID | 149992740528.9181.13105862123992376333.stgit@noble (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/utils/mount/network.c b/utils/mount/network.c index 281e9354a7fa..92457c726be7 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -39,7 +39,13 @@ #include <sys/socket.h> #include <sys/wait.h> #include <sys/stat.h> -#include <linux/in6.h> +#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 <linux/in6.h> +#endif #include <netinet/in.h> #include <rpc/rpc.h> #include <rpc/pmap_prot.h>
With glibc older than 2.24, it is always possible to include both linux/in6.h and netinet/in.h. So if the glibc is older, just hard-code the two values we need from linux/in6.h Signed-off-by: NeilBrown <neilb@suse.com> --- utils/mount/network.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html