Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
5313:1fe5f7fb6ced | 5314:0300d97c6084 |
---|---|
961 (void) ngx_cpystrn(host, u->host.data, u->host.len + 1); | 961 (void) ngx_cpystrn(host, u->host.data, u->host.len + 1); |
962 | 962 |
963 ngx_memzero(&hints, sizeof(struct addrinfo)); | 963 ngx_memzero(&hints, sizeof(struct addrinfo)); |
964 hints.ai_family = AF_UNSPEC; | 964 hints.ai_family = AF_UNSPEC; |
965 hints.ai_socktype = SOCK_STREAM; | 965 hints.ai_socktype = SOCK_STREAM; |
966 #ifdef AI_ADDRCONFIG | |
966 hints.ai_flags = AI_ADDRCONFIG; | 967 hints.ai_flags = AI_ADDRCONFIG; |
968 #endif | |
967 | 969 |
968 if (getaddrinfo((char *) host, NULL, &hints, &res) != 0) { | 970 if (getaddrinfo((char *) host, NULL, &hints, &res) != 0) { |
969 u->err = "host not found"; | 971 u->err = "host not found"; |
970 ngx_free(host); | 972 ngx_free(host); |
971 return NGX_ERROR; | 973 return NGX_ERROR; |