You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2017/07/10 15:16:34 UTC

[trafficserver] branch master updated: IpMap fix - in some cases a range node can be incorrectly re-used, effectively dropping the existing range. This fixes #2250.

This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 25650ab  IpMap fix - in some cases a range node can be incorrectly re-used, effectively dropping the existing range. This fixes #2250.
25650ab is described below

commit 25650abbb39f83cdc609b18da65574129a7071f3
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Sat Jul 8 20:54:45 2017 -0500

    IpMap fix - in some cases a range node can be incorrectly re-used, effectively dropping the existing range.
    This fixes #2250.
---
 lib/ts/IpMap.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/ts/IpMap.cc b/lib/ts/IpMap.cc
index 88d0a4b..052454a 100644
--- a/lib/ts/IpMap.cc
+++ b/lib/ts/IpMap.cc
@@ -500,9 +500,11 @@ namespace detail
         // Clip if overlap.
         if (n->_max >= min) {
           n->setMax(min_1);
-        } else if (next(n) && n->_max <= max) {
-          // request region covers next span so we can re-use that node.
-          x = next(n);
+        } else if (nullptr != (y = next(n)) && y->_max <= max) {
+          // because @a n was selected as the minimum it must be the case that
+          // y->min >= min (or y would have been selected). Therefore in this
+          // case the request covers the next node therefore it can be reused.
+          x = y;
           x->setMin(min).setMax(max).setData(payload);
           n = x; // this gets bumped again, which is correct.
         }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].