public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mount.nfs command: old glibc missing some flags
@ 2008-07-29 16:16 Chuck Lever
  2008-07-30  6:50 ` Gabor Z. Papp
  0 siblings, 1 reply; 10+ messages in thread
From: Chuck Lever @ 2008-07-29 16:16 UTC (permalink / raw)
  To: gzp-2g/1Y3AqmNE; +Cc: linux-nfs

Old versions of glibc (< 2.4) have a getaddrinfo(3) implementation, but
do not include public definitions of the AI_V4MAPPED, AI_ALL, and
AI_ADDRCONFIG flags because it was believed that these flags were not
standardized.  However, these flags have standard definitions both in
POSIX 1003 and in RFCs, and were thus included in later releases of
glibc.

To allow the mount.nfs command to build on systems with these older
versions of glibc, add conditional definitions for these flags in
utils/mount/network.c.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

Untested.  Gabor, can you please try this?

 utils/mount/network.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 75354a7..0023769 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -48,6 +48,24 @@
 #include "mount_constants.h"
 #include "network.h"
 
+/*
+ * Earlier versions of glibc's /usr/include/netdb.h exclude these
+ * definitions because it was thought they were not part of a stable
+ * POSIX standard.  However, they are defined by RFC 2553 and 3493
+ * and in POSIX 1003.1-2001, so these definitions were added in later
+ * versions of netdb.h.
+ */
+#ifndef AI_V4MAPPED
+#define AI_V4MAPPED     0x0008  /* IPv4-mapped addresses are acceptable.  */
+#endif	/* AI_V4MAPPED */
+#ifndef AI_ALL
+#define AI_ALL          0x0010  /* Return both IPv4 and IPv6 addresses.  */
+#endif	/* AI_ALL */
+#ifndef AI_ADDRCONFIG
+#define AI_ADDRCONFIG   0x0020  /* Use configuration of this host to choose \
+				   returned address type.  */
+#endif	/* AI_ADDRCONFIG */
+
 #define PMAP_TIMEOUT	(10)
 #define CONNECT_TIMEOUT	(20)
 #define MOUNT_TIMEOUT	(30)


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] mount.nfs command: old glibc missing some flags
@ 2008-07-30 23:58 Chuck Lever
       [not found] ` <20080730235637.1447.42422.stgit-lQeC5l55kZ7wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Chuck Lever @ 2008-07-30 23:58 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

Old versions of glibc (< 2.4) have a getaddrinfo(3) implementation, but
do not include public definitions of the AI_V4MAPPED, AI_ALL, and
AI_ADDRCONFIG flags because it was believed that these flags were not
standardized.  However, these flags have standard definitions both in
POSIX 1003 and in RFCs, and were thus included in later releases of
glibc.

To allow the mount.nfs command to build on systems with these older
versions of glibc, add conditional definitions for these flags in
utils/mount/network.c.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

Steve, Gabor tested this and it fixes his build problem (glibc-2.2).
If you have no objections, please apply to your nfs-utils repo.

 utils/mount/network.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 75354a7..0023769 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -48,6 +48,24 @@
 #include "mount_constants.h"
 #include "network.h"
 
+/*
+ * Earlier versions of glibc's /usr/include/netdb.h exclude these
+ * definitions because it was thought they were not part of a stable
+ * POSIX standard.  However, they are defined by RFC 2553 and 3493
+ * and in POSIX 1003.1-2001, so these definitions were added in later
+ * versions of netdb.h.
+ */
+#ifndef AI_V4MAPPED
+#define AI_V4MAPPED     0x0008  /* IPv4-mapped addresses are acceptable.  */
+#endif	/* AI_V4MAPPED */
+#ifndef AI_ALL
+#define AI_ALL          0x0010  /* Return both IPv4 and IPv6 addresses.  */
+#endif	/* AI_ALL */
+#ifndef AI_ADDRCONFIG
+#define AI_ADDRCONFIG   0x0020  /* Use configuration of this host to choose \
+				   returned address type.  */
+#endif	/* AI_ADDRCONFIG */
+
 #define PMAP_TIMEOUT	(10)
 #define CONNECT_TIMEOUT	(20)
 #define MOUNT_TIMEOUT	(30)


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-07-31  9:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-29 16:16 [PATCH] mount.nfs command: old glibc missing some flags Chuck Lever
2008-07-30  6:50 ` Gabor Z. Papp
2008-07-30 18:02   ` Chuck Lever
2008-07-30 19:00   ` Steve Dickson
2008-07-30 19:20     ` Gabor Z. Papp
2008-07-30 19:48       ` Steve Dickson
2008-07-30 20:37         ` Gabor Z. Papp
2008-07-30 23:18           ` Neil Brown
  -- strict thread matches above, loose matches on Subject: below --
2008-07-30 23:58 Chuck Lever
     [not found] ` <20080730235637.1447.42422.stgit-lQeC5l55kZ7wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-07-31  9:28   ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox