]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/hostname.c
nfs-utils: Remove all uses of AI_ADDRCONFIG
[nfs-utils.git] / utils / statd / hostname.c
index 7d704cc6654c67c8bdf7e14e70967dfdf7776d34..616a3cbf45e2668ea57efe69c5aacf6995f80cd5 100644 (file)
 #include "statd.h"
 #include "xlog.h"
 
 #include "statd.h"
 #include "xlog.h"
 
-#ifndef HAVE_DECL_AI_ADDRCONFIG
-#define AI_ADDRCONFIG  0
-#endif
-
 /**
  * statd_present_address - convert sockaddr to presentation address
  * @sap: pointer to socket address to convert
 /**
  * statd_present_address - convert sockaddr to presentation address
  * @sap: pointer to socket address to convert
@@ -212,7 +208,9 @@ statd_canonical_name(const char *hostname)
                                        buf, (socklen_t)sizeof(buf));
                freeaddrinfo(ai);
                if (!result)
                                        buf, (socklen_t)sizeof(buf));
                freeaddrinfo(ai);
                if (!result)
-                       return NULL;
+                       /* OK to use presentation address,
+                        * if no reverse map exists */
+                       return strdup(hostname);
                return strdup(buf);
        }
 
                return strdup(buf);
        }