comparison src/http/modules/ngx_http_geo_module.c @ 3456:91cff7f97a50

fix a geo range if the range includes two or more /16 networks and does not begin at /16 network boundary
author Igor Sysoev <igor@sysoev.ru>
date Thu, 25 Feb 2010 17:26:01 +0000
parents 204ea173234f
children 6802ba529ec4
comparison
equal deleted inserted replaced
3455:028f0892e0cd 3456:91cff7f97a50
587 in_addr_t n; 587 in_addr_t n;
588 ngx_uint_t h, i, s, e; 588 ngx_uint_t h, i, s, e;
589 ngx_array_t *a; 589 ngx_array_t *a;
590 ngx_http_geo_range_t *range; 590 ngx_http_geo_range_t *range;
591 591
592 for (n = start; n <= end; n += 0x10000) { 592 for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) {
593 593
594 h = n >> 16; 594 h = n >> 16;
595 595
596 if (n == start) { 596 if (n == start) {
597 s = n & 0xffff; 597 s = n & 0xffff;