diff options
Diffstat (limited to 'src/http/modules/ngx_http_geo_module.c')
-rw-r--r-- | src/http/modules/ngx_http_geo_module.c | 4 |
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); } |