Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-02-21 10:02:02 +0300
committerIgor Sysoev <igor@sysoev.ru>2009-02-21 10:02:02 +0300
commita35eaccdec4788e8fb9a883b26fc7c4dcfe1d8f8 (patch)
treeb42648c4cb4eb2cb4a1e585ed7870ede0f551600 /src/http/modules/ngx_http_geo_module.c
parenta883361c47c4fa1abf35fe2497e2bb74d9299e3e (diff)
a prelimiary IPv6 support, HTTP listen
Diffstat (limited to 'src/http/modules/ngx_http_geo_module.c')
-rw-r--r--src/http/modules/ngx_http_geo_module.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index bd6499ec7..a8f26854b 100644
--- 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_http_geo_ctx_t *ctx)
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);
}