]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/resolve.c
Don't set AI_ADDRCONFIG, even when it exists
[ngircd-alex.git] / src / ngircd / resolve.c
index 32791901215c475c95982616e8d95b321efe7680..afbef5b375122711763fe91bb80f56c1a929c8db 100644 (file)
@@ -108,9 +108,8 @@ Resolve_Name( PROC_STAT *s, const char *Host, void (*cbfunc)(int, short))
        return false;
 } /* Resolve_Name */
 
-
-#if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO)
-#if !defined(WANT_IPV6) && defined(h_errno)
+#if !defined(HAVE_WORKING_GETADDRINFO) || !defined(HAVE_GETNAMEINFO)
+#ifdef h_errno
 static char *
 Get_Error( int H_Error )
 {
@@ -233,7 +232,11 @@ ReverseLookup(const ng_ipaddr_t *IpAddr, char *resbuf, size_t reslen)
  * @return true if lookup successful, false if domain name not found
  */
 static bool
+#ifdef HAVE_WORKING_GETADDRINFO
 ForwardLookup(const char *hostname, array *IpAddr, int af)
+#else
+ForwardLookup(const char *hostname, array *IpAddr, UNUSED int af)
+#endif
 {
        ng_ipaddr_t addr;
 
@@ -242,9 +245,6 @@ ForwardLookup(const char *hostname, array *IpAddr, int af)
        struct addrinfo *a, *ai_results;
        static struct addrinfo hints;
 
-#ifdef AI_ADDRCONFIG   /* glibc has this, but not e.g. netbsd 4.0 */
-       hints.ai_flags = AI_ADDRCONFIG;
-#endif
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_protocol = IPPROTO_TCP;
        hints.ai_family = af;