diff src/core/ngx_inet.c @ 5314:0300d97c6084

Core: guard use of AI_ADDRCONFIG. Some systems (notably NetBSD and OpenBSD) lack AI_ADDRCONFIG support. Reported by Piotr Sikora.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 05 Aug 2013 13:44:56 +0400
parents 1fe5f7fb6ced
children d39ef821d03e
line wrap: on
line diff
--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -963,7 +963,9 @@ ngx_inet_resolve_host(ngx_pool_t *pool, 
     ngx_memzero(&hints, sizeof(struct addrinfo));
     hints.ai_family = AF_UNSPEC;
     hints.ai_socktype = SOCK_STREAM;
+#ifdef AI_ADDRCONFIG
     hints.ai_flags = AI_ADDRCONFIG;
+#endif
 
     if (getaddrinfo((char *) host, NULL, &hints, &res) != 0) {
         u->err = "host not found";