walters / rpms / nfs-utils

Forked from rpms/nfs-utils 6 years ago
Clone
4994286
commit 2d173a587a7dbee81ffaf246d044f384fb6487c8
4994286
Author: Chuck Lever <chuck.lever@oracle.com>
4994286
Date:   Thu Jul 31 05:24:18 2008 -0400
4994286
4994286
    mount.nfs command: old glibc missing some flags
4994286
    
4994286
    Old versions of glibc (< 2.4) have a getaddrinfo(3) implementation, but
4994286
    do not include public definitions of the AI_V4MAPPED, AI_ALL, and
4994286
    AI_ADDRCONFIG flags because it was believed that these flags were not
4994286
    standardized.  However, these flags have standard definitions both in
4994286
    POSIX 1003 and in RFCs, and were thus included in later releases of
4994286
    glibc.
4994286
    
4994286
    To allow the mount.nfs command to build on systems with these older
4994286
    versions of glibc, add conditional definitions for these flags in
4994286
    utils/mount/network.c.
4994286
    
4994286
    Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
4994286
    Signed-off-by: Steve Dickson <steved@redhat.com>
4994286
4994286
diff --git a/utils/mount/network.c b/utils/mount/network.c
4994286
index 75354a7..0023769 100644
4994286
--- a/utils/mount/network.c
4994286
+++ b/utils/mount/network.c
4994286
@@ -48,6 +48,24 @@
4994286
 #include "mount_constants.h"
4994286
 #include "network.h"
4994286
 
4994286
+/*
4994286
+ * Earlier versions of glibc's /usr/include/netdb.h exclude these
4994286
+ * definitions because it was thought they were not part of a stable
4994286
+ * POSIX standard.  However, they are defined by RFC 2553 and 3493
4994286
+ * and in POSIX 1003.1-2001, so these definitions were added in later
4994286
+ * versions of netdb.h.
4994286
+ */
4994286
+#ifndef AI_V4MAPPED
4994286
+#define AI_V4MAPPED     0x0008  /* IPv4-mapped addresses are acceptable.  */
4994286
+#endif	/* AI_V4MAPPED */
4994286
+#ifndef AI_ALL
4994286
+#define AI_ALL          0x0010  /* Return both IPv4 and IPv6 addresses.  */
4994286
+#endif	/* AI_ALL */
4994286
+#ifndef AI_ADDRCONFIG
4994286
+#define AI_ADDRCONFIG   0x0020  /* Use configuration of this host to choose \
4994286
+				   returned address type.  */
4994286
+#endif	/* AI_ADDRCONFIG */
4994286
+
4994286
 #define PMAP_TIMEOUT	(10)
4994286
 #define CONNECT_TIMEOUT	(20)
4994286
 #define MOUNT_TIMEOUT	(30)