# HG changeset patch # User Igor Sysoev # Date 1267118761 0 # Node ID 91cff7f97a502c2222ac9034958c9146cff55774 # Parent 028f0892e0cd4d8f880edb153bfeb3c1ef783ffd fix a geo range if the range includes two or more /16 networks and does not begin at /16 network boundary diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c --- a/src/http/modules/ngx_http_geo_module.c +++ b/src/http/modules/ngx_http_geo_module.c @@ -589,7 +589,7 @@ ngx_http_geo_add_range(ngx_conf_t *cf, n ngx_array_t *a; ngx_http_geo_range_t *range; - for (n = start; n <= end; n += 0x10000) { + for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) { h = n >> 16;