Klaus Demo nginx / b92e8ff
Removed sorting of getaddrinfo() results. Previously the ngx_inet_resolve_host() function sorted addresses in a way that IPv4 addresses came before IPv6 addresses. This was implemented in eaf95350d75c (1.3.10) along with the introduction of getaddrinfo() which could resolve host names to IPv6 addresses. Since the "listen" directive only used the first address, sorting allowed to preserve "listen" compatibility with the previous behavior and with the behavior of nginx built without IPv6 support. Now "listen" uses all resolved addresses which makes sorting pointless. Roman Arutyunyan 1 year, 8 months ago
1 changed file(s) with 7 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
10791079
10801080 /* MP: ngx_shared_palloc() */
10811081
1082 /* AF_INET addresses first */
1083
10841082 for (rp = res; rp != NULL; rp = rp->ai_next) {
10851083
1086 if (rp->ai_family != AF_INET) {
1087 continue;
1088 }
1089
1090 if (ngx_inet_add_addr(pool, u, rp->ai_addr, rp->ai_addrlen, n)
1091 != NGX_OK)
1092 {
1093 goto failed;
1094 }
1095 }
1096
1097 for (rp = res; rp != NULL; rp = rp->ai_next) {
1098
1099 if (rp->ai_family != AF_INET6) {
1084 switch (rp->ai_family) {
1085
1086 case AF_INET:
1087 case AF_INET6:
1088 break;
1089
1090 default:
11001091 continue;
11011092 }
11021093