comparison src/core/ngx_inet.c @ 1507:1593532dcc35 stable-0.5

r1381 merge: ignore meaningless bits in CIDR and warn about them
author Igor Sysoev <igor@sysoev.ru>
date Sat, 22 Sep 2007 19:02:39 +0000
parents db7c468c447d
children fe11e2a3946d
comparison
equal deleted inserted replaced
1506:1a1fe29fdb17 1507:1593532dcc35
212 return NGX_OK; 212 return NGX_OK;
213 } 213 }
214 214
215 in_cidr->mask = htonl((ngx_uint_t) (0 - (1 << (32 - m)))); 215 in_cidr->mask = htonl((ngx_uint_t) (0 - (1 << (32 - m))));
216 216
217 return NGX_OK; 217 if (in_cidr->addr == (in_cidr->addr & in_cidr->mask)) {
218 return NGX_OK;
219 }
220
221 in_cidr->addr &= in_cidr->mask;
222
223 return NGX_DONE;
218 } 224 }
219 225
220 226
221 ngx_int_t 227 ngx_int_t
222 ngx_parse_url(ngx_conf_t *cf, ngx_url_t *u) 228 ngx_parse_url(ngx_conf_t *cf, ngx_url_t *u)