diff options
author | NeilBrown <neilb@suse.com> | 2017-07-26 13:23:32 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2017-07-26 13:54:04 -0400 |
commit | 8af595b79b0f9f1a11e15b3dd35082c377fe6ef4 (patch) | |
tree | aa6a7ff959ff441d8b23c958a5c83abf908d1dbe /utils/mount/network.c | |
parent | f80c9984339da6f689f330b8a83d5ee503126827 (diff) | |
download | nfs-utils-8af595b79b0f9f1a11e15b3dd35082c377fe6ef4.tar.gz nfs-utils-8af595b79b0f9f1a11e15b3dd35082c377fe6ef4.tar.xz nfs-utils-8af595b79b0f9f1a11e15b3dd35082c377fe6ef4.zip |
mount: support compiling with old glibc
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>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r-- | utils/mount/network.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c index b992b01..b014dd7 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> |