diff dbutil.c @ 172:3e49d8d18005

* respect DO_HOST_LOOKUP config option
author Matt Johnston <matt@ucc.asn.au>
date Mon, 28 Feb 2005 10:15:16 +0000
parents 0cfba3034be5
children 257f09a63dab
line wrap: on
line diff
--- a/dbutil.c	Wed Jan 19 11:41:04 2005 +0000
+++ b/dbutil.c	Mon Feb 28 10:15:16 2005 +0000
@@ -397,6 +397,11 @@
 	char sbuf[NI_MAXSERV];
 	int ret;
 	unsigned int len;
+#ifdef DO_HOST_LOOKUP
+	const int flags = NI_NUMERICSERV;
+#else
+	const int flags = NI_NUMERICHOST | NI_NUMERICSERV;
+#endif
 
 	len = sizeof(struct sockaddr_storage);
 	/* Some platforms such as Solaris 8 require that len is the length
@@ -410,8 +415,9 @@
 	}
 #endif
 
+
 	ret = getnameinfo((struct sockaddr*)addr, len, hbuf, sizeof(hbuf),
-			sbuf, sizeof(sbuf), NI_NUMERICSERV);
+			sbuf, sizeof(sbuf), flags);
 
 	if (ret != 0) {
 		/* On some systems (Darwin does it) we get EINTR from getnameinfo