[PATCH] Core: guard use of AI_ADDRCONFIG

Piotr Sikora piotr at cloudflare.com
Mon Aug 5 09:38:06 UTC 2013


Hey Ruslan,

> Thanks.  I suggest a different patch instead:
> (...)
> diff --git a/auto/unix b/auto/unix
> --- a/auto/unix
> +++ b/auto/unix
> @@ -788,11 +788,7 @@ ngx_feature_incs="#include <sys/types.h>
>                    #include <netdb.h>"
>  ngx_feature_path=
>  ngx_feature_libs=
> -ngx_feature_test='struct addrinfo hints, *res;
> -                  hints.ai_family = AF_UNSPEC;
> -                  hints.ai_socktype = SOCK_STREAM;
> -                  hints.ai_flags = AI_ADDRCONFIG;
> -                  if (getaddrinfo("localhost", NULL, &hints, &res) != 0)
> -                      return 1;
> +ngx_feature_test='struct addrinfo *res;
> +                  if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
>                    freeaddrinfo(res)'
>  . auto/feature

I was just about to send an updated patch because I've noticed that
hints struct wasn't zero'ed in the feature test, but reverting those
changes altogether looks like a better solution... OK from me.

Best regards,
Piotr Sikora



More information about the nginx-devel mailing list