[ovs-dev] [PATCH] lib: fix cmap_find_protected

Zang MingJie zealot0630 at gmail.com
Mon Dec 24 09:12:19 UTC 2018


cmap_find_protected calculated wrong h2 hash which causing entries with
duplicated id inserted into the cmap.

Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-December/047945.html
Signed-off-by: Zang MingJie <zealot0630 at gmail.com>
---
 lib/cmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cmap.c b/lib/cmap.c
index cb9cd32ab..c9eef3f4a 100644
--- a/lib/cmap.c
+++ b/lib/cmap.c
@@ -568,7 +568,7 @@ cmap_find_protected(const struct cmap *cmap, uint32_t hash)
 {
     struct cmap_impl *impl = cmap_get_impl(cmap);
     uint32_t h1 = rehash(impl, hash);
-    uint32_t h2 = other_hash(hash);
+    uint32_t h2 = other_hash(h1);
     struct cmap_node *node;
 
     node = cmap_find_bucket_protected(impl, hash, h1);
-- 
2.20.1



More information about the dev mailing list