]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: ebtree/scope: fix insertion and removal of duplicates in scope-aware trees
authorWilly Tarreau <w@1wt.eu>
Mon, 13 Nov 2017 15:16:09 +0000 (16:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 13 Nov 2017 18:34:09 +0000 (19:34 +0100)
commitd19ec7d5021ec2a813ec9eed245f20bfade22e97
tree56aa7298d6702a3ff427247a37a47ccbf84fa050
parentfa5c812a6bab78a0c0c53ccfeb9393dd3dcaec80
BUG/MAJOR: ebtree/scope: fix insertion and removal of duplicates in scope-aware trees

Commit ca30839 and following ("MINOR: ebtree: implement the scope-aware
functions for eb32") improperly dealt with the scope in duplicate trees.
The insertion was too lenient in that it would always mark the whole
rightmost chain below the insertion point, and the removal could leave
marks of non-existing scopes causing next()/first() to visit the wrong
branch and return NULL.

For insertion, we must only tag the nodes between the head of the dup
tree and the insertion point which is the top of the lowest subtree. For
removal, the new scope must be be calculated by oring the scopes of the
two new branches and is irrelevant to the previous values.

No backport is needed, this is purely 1.8-specific.
ebtree/eb32sctree.c