diff src/http/modules/ngx_http_realip_module.c @ 448:76a79816b771 NGINX_0_7_36

nginx 0.7.36 *) Feature: a preliminary IPv6 support; the "listen" directive of the HTTP module supports IPv6. *) Bugfix: the $ancient_browser variable did not work for browsers preset by a "modern_browser" directives.
author Igor Sysoev <http://sysoev.ru>
date Sat, 21 Feb 2009 00:00:00 +0300
parents b246022ef454
children a8424ffa495c
line wrap: on
line diff
--- 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;