aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_access_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_access_module.c')
-rw-r--r--src/http/modules/ngx_http_access_module.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_access_module.c b/src/http/modules/ngx_http_access_module.c
index 12f0b9922..8cd2e0e13 100644
--- 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_t *r)
/* 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;