]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: map: mapfile ordering also matters for tree-based match types
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 11 Jan 2024 09:31:04 +0000 (10:31 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 11 Jan 2024 10:13:54 +0000 (11:13 +0100)
commit3b0bf5097bb65e83c1ddb2f87c4eae43cc3000c8
tree0c079c7183f19b8fedfb3f555a05e407ed368c9b
parentf6ab0446fba1f87b1a703acf98ca4587609bd122
MINOR: map: mapfile ordering also matters for tree-based match types

Willy made me realize that tree-based matching may also suffer from
out-of-order mapfile loading, as opposed to what's being said in
b546bb6d ("BUG/MINOR: map: list-based matching potential ordering
regression") and the associated REGTEST.

Indeed, in case of duplicated keys, we want to be sure that only the key
that was first seen in the file will be returned (as long as it is not
removed). The above fix is still valid, and the list-based match regtest
will also prevent regressions for tree-based match since mapfile loading
logic is currently match-type agnostic.

But let's clarify that by making both the code comment and the regtest
more precise.
reg-tests/http-rules/map_ordering.map
reg-tests/http-rules/map_ordering.vtc
src/pattern.c