]> git.kaiwu.me - nginx.git/commitdiff
Access module: fixed inheritance of allow/deny ipv6 rules.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 10 Apr 2012 13:25:53 +0000 (13:25 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 10 Apr 2012 13:25:53 +0000 (13:25 +0000)
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).

src/http/modules/ngx_http_access_module.c

index 84a75d777ab80c0ce2e35a21445426bd6e6627cc..70a4262fccb87f0ca0d4d57b1b9b9457ca12b26e 100644 (file)
@@ -351,14 +351,19 @@ ngx_http_access_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_http_access_loc_conf_t  *prev = parent;
     ngx_http_access_loc_conf_t  *conf = child;
 
-    if (conf->rules == NULL) {
+#if (NGX_HAVE_INET6)
+
+    if (conf->rules == NULL && conf->rules6 == NULL) {
         conf->rules = prev->rules;
+        conf->rules6 = prev->rules6;
     }
 
-#if (NGX_HAVE_INET6)
-    if (conf->rules6 == NULL) {
-        conf->rules6 = prev->rules6;
+#else
+
+    if (conf->rules == NULL) {
+        conf->rules = prev->rules;
     }
+
 #endif
 
     return NGX_CONF_OK;