summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_realip_module.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2013-07-11 16:07:25 +0400
committerVladimir Homutov <vl@nginx.com>2013-07-11 16:07:25 +0400
commitaf18946d769296d9efead825a0d1aa6a1a41fe74 (patch)
tree6b34cebcacea394e0126bcff647a3e73ab25c36d /src/http/modules/ngx_http_realip_module.c
parent050f74b751c10eeb2491ec6509d0508a7e690209 (diff)
downloadnginx-af18946d769296d9efead825a0d1aa6a1a41fe74.tar.gz
nginx-af18946d769296d9efead825a0d1aa6a1a41fe74.tar.bz2
Core: extended ngx_sock_ntop() with socklen parameter.
On Linux, sockaddr length is required to process unix socket addresses properly due to unnamed sockets (which don't have sun_path set at all) and abstract namespace sockets.
Diffstat (limited to 'src/http/modules/ngx_http_realip_module.c')
-rw-r--r--src/http/modules/ngx_http_realip_module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_realip_module.c b/src/http/modules/ngx_http_realip_module.c
index ed9c5f9e8..b15954759 100644
--- a/src/http/modules/ngx_http_realip_module.c
+++ b/src/http/modules/ngx_http_realip_module.c
@@ -230,7 +230,8 @@ ngx_http_realip_set_addr(ngx_http_request_t *r, ngx_addr_t *addr)
c = r->connection;
- len = ngx_sock_ntop(addr->sockaddr, text, NGX_SOCKADDR_STRLEN, 0);
+ len = ngx_sock_ntop(addr->sockaddr, addr->socklen, text,
+ NGX_SOCKADDR_STRLEN, 0);
if (len == 0) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}