comparison src/http/modules/ngx_http_realip_module.c @ 2202:2300ab9b069e

*) refactor ngx_ptocidr() *) allow address without bitmask *) thus now ngx_http_geo_module accepts addresses without bitmask
author Igor Sysoev <igor@sysoev.ru>
date Tue, 26 Aug 2008 14:19:37 +0000
parents 29d26406e1bd
children 74d270c8821e
comparison
equal deleted inserted replaced
2201:49a269b67213 2202:2300ab9b069e
249 return NGX_CONF_ERROR; 249 return NGX_CONF_ERROR;
250 } 250 }
251 251
252 value = cf->args->elts; 252 value = cf->args->elts;
253 253
254 from->addr = inet_addr((char *) value[1].data);
255
256 if (from->addr != INADDR_NONE) {
257 from->mask = 0xffffffff;
258
259 return NGX_CONF_OK;
260 }
261
262 rc = ngx_ptocidr(&value[1], &in_cidr); 254 rc = ngx_ptocidr(&value[1], &in_cidr);
263 255
264 if (rc == NGX_ERROR) { 256 if (rc == NGX_ERROR) {
265 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"", 257 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"",
266 &value[1]); 258 &value[1]);