# HG changeset patch # User Ruslan Ermilov # Date 1471957146 -10800 # Node ID 1301a58b5dac430ba8ac9d28b138ab13be615fbd # Parent ec141a44641b2014016a377132c8272f52f2ee2e Geo: fixed removing a range in certain cases. If the range includes two or more /16 networks and does not start at the /16 boundary, the last subrange was not removed (see 91cff7f97a50 for details). diff -r ec141a44641b -r 1301a58b5dac src/http/modules/ngx_http_geo_module.c --- a/src/http/modules/ngx_http_geo_module.c Tue Aug 23 15:57:29 2016 +0300 +++ b/src/http/modules/ngx_http_geo_module.c Tue Aug 23 15:59:06 2016 +0300 @@ -966,7 +966,7 @@ warn = 0; - for (n = start; n <= end; n += 0x10000) { + for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) { h = n >> 16; diff -r ec141a44641b -r 1301a58b5dac src/stream/ngx_stream_geo_module.c --- a/src/stream/ngx_stream_geo_module.c Tue Aug 23 15:57:29 2016 +0300 +++ b/src/stream/ngx_stream_geo_module.c Tue Aug 23 15:59:06 2016 +0300 @@ -916,7 +916,7 @@ warn = 0; - for (n = start; n <= end; n += 0x10000) { + for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) { h = n >> 16;