Hi all,
I have a little question about miniflow_hash().
At the end of miniflow_hash, "p - flow->values" is used as the second
paramter of mhash_finish. But "p - flow->valuse" is not the number of
bytes which has been added to hash in miniflow_hash. The second
parameter should be "sizeof hash_map + count_1bits(hash_map) * sizeof
*p".
Is this a real problem or I'm missing something?


diff --git a/lib/flow.c b/lib/flow.c
index 06ba036..dc6f4b8 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -1680,7 +1680,8 @@ miniflow_hash(const struct miniflow *flow, uint32_t basis)
     hash = mhash_add(hash, hash_map);
     hash = mhash_add(hash, hash_map >> 32);

-    return mhash_finish(hash, p - flow->values);
+    return mhash_finish(hash,
+                        sizeof hash_map + count_1bits(hash_map) * sizeof *p);
 }

cheers,
kmindg
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to