Skip to content

Commit

Permalink
Geo: fixed removing a range in certain cases.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
mdocguard committed Aug 23, 2016
1 parent 36e1c88 commit f927ab8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/http/modules/ngx_http_geo_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ ngx_http_geo_delete_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,

warn = 0;

for (n = start; n <= end; n += 0x10000) {
for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) {

h = n >> 16;

Expand Down
2 changes: 1 addition & 1 deletion src/stream/ngx_stream_geo_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ ngx_stream_geo_delete_range(ngx_conf_t *cf, ngx_stream_geo_conf_ctx_t *ctx,

warn = 0;

for (n = start; n <= end; n += 0x10000) {
for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) {

h = n >> 16;

Expand Down

0 comments on commit f927ab8

Please sign in to comment.