mirror of
https://github.com/nginx/nginx.git
synced 2026-06-27 12:21:57 +00:00
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).
This commit is contained in:
parent
3ef52765c8
commit
b9c226abe0
1 changed files with 9 additions and 4 deletions
|
|
@ -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 (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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue