Mercurial > hg > nginx
comparison src/core/ngx_inet.c @ 1380:b590a528fd41
ignore meaningless bits in CIDR and warn about them
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 10 Aug 2007 13:13:28 +0000 |
parents | db7c468c447d |
children | fe11e2a3946d |
comparison
equal
deleted
inserted
replaced
1379:cc8ac1936aa4 | 1380:b590a528fd41 |
---|---|
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) |