[nginx] svn commit: r4581 - trunk/src/http/modules

mdounin at mdounin.ru mdounin at mdounin.ru
Tue Apr 10 13:25:53 UTC 2012


Author: mdounin
Date: 2012-04-10 13:25:53 +0000 (Tue, 10 Apr 2012)
New Revision: 4581
URL: http://trac.nginx.org/nginx/changeset/4581/nginx

Log:
Access module: fixed inheritance of allow/deny ipv6 rules.

Previous (incorrect) behaviour was to inherit ipv6 rules separately from
ipv4 ones.  Now all rules are either inherited (if there are no rules
defined at current level) or not (if there are any rules defined).


Modified:
   trunk/src/http/modules/ngx_http_access_module.c

Modified: trunk/src/http/modules/ngx_http_access_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_access_module.c	2012-04-10 11:28:59 UTC (rev 4580)
+++ trunk/src/http/modules/ngx_http_access_module.c	2012-04-10 13:25:53 UTC (rev 4581)
@@ -351,14 +351,19 @@
     ngx_http_access_loc_conf_t  *prev = parent;
     ngx_http_access_loc_conf_t  *conf = child;
 
+#if (NGX_HAVE_INET6)
+
+    if (conf->rules == NULL && conf->rules6 == NULL) {
+        conf->rules = prev->rules;
+        conf->rules6 = prev->rules6;
+    }
+
+#else
+
     if (conf->rules == NULL) {
         conf->rules = prev->rules;
     }
 
-#if (NGX_HAVE_INET6)
-    if (conf->rules6 == NULL) {
-        conf->rules6 = prev->rules6;
-    }
 #endif
 
     return NGX_CONF_OK;



More information about the nginx-devel mailing list