Skip to contentSkip to conversation

mount: Introduce IPv6-aware DNS resolver API function

PATCH New Chuck Lever 1 participant 1 message Feb 18, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 14/17 mount: Introduce IPv6-aware DNS resolver API function

To support mounting IPv6 servers, introduce a function in network.c that can resolve hostnames to either IPv4 or IPv6 addresses.

---

 configure.ac          |    2 +
 utils/mount/network.c |   70 +++++++++++++++++++++++++++++++++++++++++++++++++
 utils/mount/network.h |    1 +
 3 files changed, 73 insertions(+), 0 deletions(-)
configure.ac +2 -0
index 3e600b4..4372fbe 100644
@@ -298,6 +298,8 @@ have_bindresvport6=none
 if test "$enable_ipv6" = yes; then
     AC_CHECK_FUNC(bindresvport6, [have_bindresvport6=lib])
     AC_CHECK_FUNC(inet_ntop, , , AC_MSG_ERROR(Function 'inet_ntop' not found.))
+    AC_CHECK_FUNC(getaddrinfo, , ,
+                AC_MSG_ERROR(Function 'getaddrinfo' not found.))
 fi
 AM_CONDITIONAL(CONFIG_BRP6, [test "$have_bindresvport6" = "none"])
 
utils/mount/network.c +70 -0

76 lines not on this page · raw message

utils/mount/network.h +1 -0
index 7cabb16..97538b6 100644
@@ -48,6 +48,7 @@ static const struct timeval RETRY_TIMEOUT = { 3, 0 };
 
 int probe_bothports(clnt_addr_t *, clnt_addr_t *);
 int nfs_gethostbyname(const char *, struct sockaddr_in *);
+int nfs_name_to_address(const char *, const sa_family_t, struct sockaddr *);
 int nfs_client_address(const struct sockaddr *, struct sockaddr *, socklen_t *);
 int nfs_call_umount(clnt_addr_t *, dirpath *);
 int clnt_ping(struct sockaddr_in *, const unsigned long,