comparison auto/unix @ 5312:ec8594b9bf11

Core: only resolve address families configured on the local system. This is done by passing AI_ADDRCONFIG to getaddrinfo(). On Linux, setting net.ipv6.conf.all.disable_ipv6 to 1 will now be respected. On FreeBSD, AI_ADDRCONFIG filtering is currently implemented by attempting to create a datagram socket for the corresponding family, which succeeds even if the system doesn't in fact have any addresses of that family configured. That is, if the system with IPv6 support in the kernel doesn't have IPv6 addresses configured, AI_ADDRCONFIG will filter out IPv6 only inside a jail without IPv6 addresses or with IPv6 disabled.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 05 Aug 2013 10:55:59 +0400
parents eaf95350d75c
children 0300d97c6084
comparison
equal deleted inserted replaced
5311:ae3fd1ca62e0 5312:ec8594b9bf11
786 ngx_feature_incs="#include <sys/types.h> 786 ngx_feature_incs="#include <sys/types.h>
787 #include <sys/socket.h> 787 #include <sys/socket.h>
788 #include <netdb.h>" 788 #include <netdb.h>"
789 ngx_feature_path= 789 ngx_feature_path=
790 ngx_feature_libs= 790 ngx_feature_libs=
791 ngx_feature_test='struct addrinfo *res; 791 ngx_feature_test='struct addrinfo hints, *res;
792 if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1; 792 hints.ai_family = AF_UNSPEC;
793 hints.ai_socktype = SOCK_STREAM;
794 hints.ai_flags = AI_ADDRCONFIG;
795 if (getaddrinfo("localhost", NULL, &hints, &res) != 0)
796 return 1;
793 freeaddrinfo(res)' 797 freeaddrinfo(res)'
794 . auto/feature 798 . auto/feature