Use template-specific key compare fn when deleting records
A simple memcmp won't work when comparing pointer-keys, such as those
used by the bihash_vec8_8.h template.
@@ -468,7 +468,7 @@ static inline int BV (clib_bihash_add_del_inline)
*/
for (i = 0; i < limit; i++)
{
- if (!memcmp (&(v->kvp[i]), &add_v->key, sizeof (add_v->key)))
+ if (BV (clib_bihash_key_compare) (v->kvp[i].key, add_v->key))
{
CLIB_MEMORY_BARRIER (); /* Add a delay */
clib_memcpy_fast (&(v->kvp[i]), add_v, sizeof (*add_v));
@@ -519,7 +519,7 @@ static inline int BV (clib_bihash_add_del_inline)
for (i = 0; i < limit; i++)
{
/* Found the key? Kill it... */
- if (!memcmp (&(v->kvp[i]), &add_v->key, sizeof (add_v->key)))
+ if (BV (clib_bihash_key_compare) (v->kvp[i].key, add_v->key))
{
clib_memset (&(v->kvp[i]), 0xff, sizeof (*(add_v)));
/* Is the bucket empty? */
