summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/hash.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-03-26 00:57:50 +0100
committerBeno�t Ganne <bganne@cisco.com>2022-03-28 10:04:31 +0000
commit87997686ee9a6c7aecec423f05bec21a938ec9bb (patch)
tree9772c2abf6befda27715951e852d88eb5380f564 /src/vppinfra/hash.h
parenta5bfe6cd0e0b1e413bbb2decfcdb97c65b79cbce (diff)
vppinfra: avoid mem overflow in hash_memory()
Change-Id: Ic81aafd5f378de06e5ea8cdd6a59e07ff1a7afca Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/hash.h')
-rw-r--r--src/vppinfra/hash.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vppinfra/hash.h b/src/vppinfra/hash.h
index f5735bc92ee..968c7781c36 100644
--- a/src/vppinfra/hash.h
+++ b/src/vppinfra/hash.h
@@ -527,6 +527,12 @@ do { \
#define hash_mix64_step_3(a,b,c) hash_mix_step(a,b,c,35,49,11)
#define hash_mix64_step_4(a,b,c) hash_mix_step(a,b,c,12,18,22)
+#if uword_bits == 64
+#define hash_mix(a, b, c) hash_mix64 (a, b, c)
+#else
+#define hash_mix(a, b, c) hash_mix32 (a, b, c)
+#endif
+
/* Hash function based on that of Bob Jenkins (bob_jenkins@compuserve.com).
Thanks, Bob. */
#define hash_mix64(a0,b0,c0) \