diff src/http/modules/ngx_http_access_module.c @ 2512:2e91aecb9e57

a prelimiary IPv6 support, HTTP listen
author Igor Sysoev <igor@sysoev.ru>
date Sat, 21 Feb 2009 07:02:02 +0000
parents 2300ab9b069e
children a472d954c534
line wrap: on
line diff
--- a/src/http/modules/ngx_http_access_module.c
+++ b/src/http/modules/ngx_http_access_module.c
@@ -9,8 +9,6 @@
 #include <ngx_http.h>
 
 
-/* AF_INET only */
-
 typedef struct {
     in_addr_t     mask;
     in_addr_t     addr;
@@ -103,6 +101,10 @@ ngx_http_access_handler(ngx_http_request
 
     /* AF_INET only */
 
+    if (r->connection->sockaddr->sa_family != AF_INET) {
+        return NGX_DECLINED;
+    }
+
     sin = (struct sockaddr_in *) r->connection->sockaddr;
 
     rule = alcf->rules->elts;