# HG changeset patch # User Ruslan Ermilov # Date 1337010757 0 # Node ID f675474435e04045f1c8d3133c99704c204d5c42 # Parent 3152e4c371d7df171e3e7848e63c67b807b2bdc6 Reverted previous attempt to fix complation warning introduced in r4624 and actually fixed it. diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -2713,31 +2713,30 @@ ngx_http_get_forwarded_addr(ngx_http_req struct in6_addr *inaddr6; #endif +#if (NGX_SUPPRESS_WARN) + inaddr = NULL; +#if (NGX_HAVE_INET6) + inaddr6 = NULL; +#endif +#endif + family = addr->sockaddr->sa_family; - switch (family) { + if (family == AF_INET) { + inaddr = &((struct sockaddr_in *) addr->sockaddr)->sin_addr.s_addr; + } #if (NGX_HAVE_INET6) - case AF_INET6: + else if (family == AF_INET6) { inaddr6 = &((struct sockaddr_in6 *) addr->sockaddr)->sin6_addr; if (IN6_IS_ADDR_V4MAPPED(inaddr6)) { family = AF_INET; inaddr = (in_addr_t *) &inaddr6->s6_addr[12]; } - - break; + } #endif -#if (NGX_HAVE_UNIX_DOMAIN) - case AF_UNIX: - break; -#endif - - default: /* AF_INET */ - inaddr = &((struct sockaddr_in *) addr->sockaddr)->sin_addr.s_addr; - } - for (cidr = proxies->elts, i = 0; i < proxies->nelts; i++) { if (cidr[i].family != family) { goto next;