Fix AVL tree traversal in cache_record_find and cache_host_is_known
authorMartin Röder <mroeder@metz-connect.com>
Wed, 18 Oct 2023 16:32:34 +0000 (18:32 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 18 Oct 2023 16:33:50 +0000 (18:33 +0200)
commitc286c51a9bd931d023a55988c0e89574ee6d8ffa
tree258ecf5bd0971522699238285d901234f892b67f
parent26c97a5a50bf914eb8551685b9c0d4e52d9a168b
Fix AVL tree traversal in cache_record_find and cache_host_is_known

The AVL tree traversal in both functions systematically misses the last
AVL tree element. This can lead to duplicate cache entries and lookup
failures.

The fix duplicates the correct AVL tree traversal approach of
cache_dump_recursive().

Signed-off-by: Martin Röder <mroeder@metz-connect.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
cache.c