aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_inet.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2013-08-05 13:44:56 +0400
committerRuslan Ermilov <ru@nginx.com>2013-08-05 13:44:56 +0400
commit3693daa20f13712afc413691a74c6116c5a5bce2 (patch)
treee86b5fd2453650b694664f5b2dad794c5f9df8bc /src/core/ngx_inet.c
parent4d1b08bb1cb1edaa413d0f652ba68a7fba292419 (diff)
downloadnginx-3693daa20f13712afc413691a74c6116c5a5bce2.tar.gz
nginx-3693daa20f13712afc413691a74c6116c5a5bce2.zip
Core: guard use of AI_ADDRCONFIG.
Some systems (notably NetBSD and OpenBSD) lack AI_ADDRCONFIG support. Reported by Piotr Sikora.
Diffstat (limited to 'src/core/ngx_inet.c')
-rw-r--r--src/core/ngx_inet.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c
index bb03720f7..0792d6e8c 100644
--- 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_url_t *u)
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";