aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_realip_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_realip_module.c')
-rw-r--r--src/http/modules/ngx_http_realip_module.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_realip_module.c b/src/http/modules/ngx_http_realip_module.c
index 44c74a182..58bdeeb37 100644
--- a/src/http/modules/ngx_http_realip_module.c
+++ b/src/http/modules/ngx_http_realip_module.c
@@ -14,8 +14,6 @@
#define NGX_HTTP_REALIP_HEADER 2
-/* AF_INET only */
-
typedef struct {
in_addr_t mask;
in_addr_t addr;
@@ -209,6 +207,10 @@ found:
/* AF_INET only */
+ if (r->connection->sockaddr->sa_family != AF_INET) {
+ return NGX_DECLINED;
+ }
+
sin = (struct sockaddr_in *) c->sockaddr;
from = rlcf->from->elts;