comparison src/http/modules/ngx_http_geo_module.c @ 686:2e8a942c8872 NGINX_1_3_6

nginx 1.3.6 *) Feature: the ngx_http_gunzip_filter_module. *) Feature: the "memcached_gzip_flag" directive. *) Feature: the "always" parameter of the "gzip_static" directive. *) Bugfix: in the "limit_req" directive; the bug had appeared in 1.1.14. Thanks to Charles Chen. *) Bugfix: nginx could not be built by gcc 4.7 with -O2 optimization if the --with-ipv6 option was used.
author Igor Sysoev <http://sysoev.ru>
date Wed, 12 Sep 2012 00:00:00 +0400
parents 660139fd80ca
children 88a1b4797f2e
comparison
equal deleted inserted replaced
685:0a9f545d4f4b 686:2e8a942c8872
231 } 231 }
232 232
233 #if (NGX_HAVE_INET6) 233 #if (NGX_HAVE_INET6)
234 234
235 if (addr.sockaddr->sa_family == AF_INET6) { 235 if (addr.sockaddr->sa_family == AF_INET6) {
236 u_char *p;
237 in_addr_t inaddr;
236 struct in6_addr *inaddr6; 238 struct in6_addr *inaddr6;
237 239
238 inaddr6 = &((struct sockaddr_in6 *) addr.sockaddr)->sin6_addr; 240 inaddr6 = &((struct sockaddr_in6 *) addr.sockaddr)->sin6_addr;
239 241
240 if (IN6_IS_ADDR_V4MAPPED(inaddr6)) { 242 if (IN6_IS_ADDR_V4MAPPED(inaddr6)) {
241 return ntohl(*(in_addr_t *) &inaddr6->s6_addr[12]); 243 p = inaddr6->s6_addr;
244
245 inaddr = p[12] << 24;
246 inaddr += p[13] << 16;
247 inaddr += p[14] << 8;
248 inaddr += p[15];
249
250 return inaddr;
242 } 251 }
243 } 252 }
244 253
245 #endif 254 #endif
246 255