2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-01 23:05:29 +00:00

cmap: Fix cmap_next_position()

cmap_next_position() didn't update the node pointer while iterating through a
list of nodes with the same hash.
This commit fixes the bug and improve test-cmap to detect it.

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Daniele Di Proietto
2014-07-16 10:46:20 -07:00
committed by Ben Pfaff
parent 95fb793ae7
commit cd50723cf5
2 changed files with 20 additions and 2 deletions

View File

@@ -854,7 +854,7 @@ cmap_next_position(const struct cmap *cmap,
const struct cmap_node *node = cmap_node_next(&b->nodes[entry]);
unsigned int i;
for (i = 0; node; i++) {
for (i = 0; node; i++, node = cmap_node_next(node)) {
if (i == offset) {
if (cmap_node_next(node)) {
offset++;