]> git.kaiwu.me - nginx.git/commitdiff
merge r3457:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 7 Jun 2010 10:04:13 +0000 (10:04 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 7 Jun 2010 10:04:13 +0000 (10:04 +0000)
fix a geo range if the range includes two or more /16 networks
and does not begin at /16 network boundary

src/http/modules/ngx_http_geo_module.c

index 0ec8d093b98a55bd9589a508e92d3dcb3e87c062..a184a7ae3f699da03688e0bc684c370cb73aba5e 100644 (file)
@@ -589,7 +589,7 @@ ngx_http_geo_add_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
     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;