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:
committed by
Ben Pfaff
parent
95fb793ae7
commit
cd50723cf5
@@ -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++;
|
||||
|
Reference in New Issue
Block a user