Klaus Demo nginx / 7c6971c
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. Ruslan Ermilov 8 years ago
2 changed file(s) with 7 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
787787 #include <netdb.h>"
788788 ngx_feature_path=
789789 ngx_feature_libs=
790 ngx_feature_test='struct addrinfo *res;
791 if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
790 ngx_feature_test='struct addrinfo hints, *res;
791 hints.ai_family = AF_UNSPEC;
792 hints.ai_socktype = SOCK_STREAM;
793 hints.ai_flags = AI_ADDRCONFIG;
794 if (getaddrinfo("localhost", NULL, &hints, &res) != 0)
795 return 1;
792796 freeaddrinfo(res)'
793797 . auto/feature
962962 ngx_memzero(&hints, sizeof(struct addrinfo));
963963 hints.ai_family = AF_UNSPEC;
964964 hints.ai_socktype = SOCK_STREAM;
965 hints.ai_flags = AI_ADDRCONFIG;
965966
966967 if (getaddrinfo((char *) host, NULL, &hints, &res) != 0) {
967968 u->err = "host not found";