Mercurial > hg > nginx-vendor-current
diff src/http/modules/ngx_http_access_module.c @ 454:a8424ffa495c NGINX_0_7_39
nginx 0.7.39
*) Bugfix: large response with SSI might hang, if gzipping was enabled;
the bug had appeared in 0.7.28.
Thanks to Artem Bokhan.
*) Bugfix: a segmentation fault might occur in worker process, if short
static variants are used in a "try_files" directive.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 02 Mar 2009 00:00:00 +0300 |
parents | 76a79816b771 |
children | f39b9e29530d |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_access_module.c +++ b/src/http/modules/ngx_http_access_module.c @@ -141,7 +141,7 @@ ngx_http_access_rule(ngx_conf_t *cf, ngx ngx_int_t rc; ngx_str_t *value; - ngx_inet_cidr_t in_cidr; + ngx_cidr_t cidr; ngx_http_access_rule_t *rule; if (alcf->rules == NULL) { @@ -168,7 +168,7 @@ ngx_http_access_rule(ngx_conf_t *cf, ngx return NGX_CONF_OK; } - rc = ngx_ptocidr(&value[1], &in_cidr); + rc = ngx_ptocidr(&value[1], &cidr); if (rc == NGX_ERROR) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"", @@ -176,13 +176,19 @@ ngx_http_access_rule(ngx_conf_t *cf, ngx return NGX_CONF_ERROR; } + if (cidr.family != AF_INET) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "\"allow\" supports IPv4 only"); + return NGX_CONF_ERROR; + } + if (rc == NGX_DONE) { ngx_conf_log_error(NGX_LOG_WARN, cf, 0, "low address bits of %V are meaningless", &value[1]); } - rule->mask = in_cidr.mask; - rule->addr = in_cidr.addr; + rule->mask = cidr.u.in.mask; + rule->addr = cidr.u.in.addr; return NGX_CONF_OK; }