Mailing List Archive

[6878] cherokee/trunk/cherokee/util.c: Adds AI_ADDRCONFIG in cherokee_gethostbyname(), treating
Revision: 6878
http://svn.cherokee-project.com/changeset/6878
Author: aperez
Date: 2011-10-01 22:43:18 +0200 (Sat, 01 Oct 2011)
Log Message:
-----------
Adds AI_ADDRCONFIG in cherokee_gethostbyname(), treating
the "localhost" special case.

Modified Paths:
--------------
cherokee/trunk/cherokee/util.c

Modified: cherokee/trunk/cherokee/util.c
===================================================================
--- cherokee/trunk/cherokee/util.c 2011-10-01 20:43:15 UTC (rev 6877)
+++ cherokee/trunk/cherokee/util.c 2011-10-01 20:43:18 UTC (rev 6878)
@@ -768,6 +768,17 @@

hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
+#ifdef AI_ADDRCONFIG
+ if ((strcmp(hostname, "127.0.0.1") != 0) &&
+ (strcmp(hostname, "localhost") != 0) &&
+ (strcmp(hostname, "localhost.localdomain") != 0) &&
+ (strcmp(hostname, "::1") != 0) &&
+ (strcmp(hostname, "localhost6") != 0) &&
+ (strcmp(hostname, "localhost6.localdomain6") != 0))
+ {
+ hints.ai_flags = AI_ADDRCONFIG;
+ }
+#endif

/* Resolve address
*/