diff src/http/modules/ngx_http_geo_module.c @ 2512:2e91aecb9e57

a prelimiary IPv6 support, HTTP listen
author Igor Sysoev <igor@sysoev.ru>
date Sat, 21 Feb 2009 07:02:02 +0000
parents 1aff348d9aa8
children a472d954c534
line wrap: on
line diff
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -175,6 +175,10 @@ ngx_http_geo_addr(ngx_http_request_t *r,
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "http geo started: %V", &r->connection->addr_text);
 
+        if (r->connection->sockaddr->sa_family != AF_INET) {
+            return 0;
+        }
+
         sin = (struct sockaddr_in *) r->connection->sockaddr;
         return ntohl(sin->sin_addr.s_addr);
     }