hmap: Fix bug in hmap_replace().
authorBen Pfaff <blp@nicira.com>
Tue, 3 Nov 2009 20:50:46 +0000 (12:50 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 4 Nov 2009 23:01:02 +0000 (15:01 -0800)
When hmap_replace() replaces one hash table node by another, it must
ensure that any nodes following the old node also follow the new node,
by copying the "next" pointer from "old" to "new".

lib/hmap.h

index 1809a91..9808805 100644 (file)
@@ -190,6 +190,7 @@ hmap_replace(struct hmap *hmap,
     }
     *bucket = new;
     new->hash = old->hash;
+    new->next = old->next;
 }
 
 static inline struct hmap_node *