aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-04-10 13:25:53 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-04-10 13:25:53 +0000
commitb9c226abe074b82a2bbca514ab5539ee0672fb01 (patch)
tree46c3fa2400f91e84c670a8fa2ad3029b0703670f
parent3ef52765c84ff979e7ae13ccd2ad3497b93b777c (diff)
downloadnginx-b9c226abe074b82a2bbca514ab5539ee0672fb01.tar.gz
nginx-b9c226abe074b82a2bbca514ab5539ee0672fb01.zip
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).
-rw-r--r--src/http/modules/ngx_http_access_module.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_access_module.c b/src/http/modules/ngx_http_access_module.c
index 84a75d777..70a4262fc 100644
--- a/src/http/modules/ngx_http_access_module.c
+++ b/src/http/modules/ngx_http_access_module.c
@@ -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;