Skip to content

Commit

Permalink
cmap: Fix hashing in cmap_find_protected().
Browse files Browse the repository at this point in the history
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@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
kghost authored and blp committed Dec 24, 2018
1 parent 5078ae8 commit a2d1a08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cmap.c
Expand Up @@ -490,7 +490,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);
Expand Down

0 comments on commit a2d1a08

Please sign in to comment.