Permalink
Browse files

Adds AI_ADDRCONFIG in cherokee_gethostbyname(), treating

the "localhost" special case.

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6878 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 03257c4 commit 92b1d548ccd9c4e952ab0aa51626bec326114b12 @skarcha skarcha committed Oct 1, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 cherokee/util.c
View
@@ -768,6 +768,17 @@ cherokee_gethostbyname (const char *hostname, struct addrinfo **addr)
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
*/

0 comments on commit 92b1d54

Please sign in to comment.