summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bihash_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/bihash_template.c')
-rw-r--r--src/vppinfra/bihash_template.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c
index 97c4cd08eb1..b090041ad29 100644
--- a/src/vppinfra/bihash_template.c
+++ b/src/vppinfra/bihash_template.c
@@ -906,12 +906,12 @@ u8 *BV (format_bihash) (u8 * s, va_list * args)
}
void BV (clib_bihash_foreach_key_value_pair)
- (BVT (clib_bihash) * h, void *callback, void *arg)
+ (BVT (clib_bihash) * h,
+ BV (clib_bihash_foreach_key_value_pair_cb) cb, void *arg)
{
int i, j, k;
BVT (clib_bihash_bucket) * b;
BVT (clib_bihash_value) * v;
- void (*fp) (BVT (clib_bihash_kv) *, void *) = callback;
if (PREDICT_FALSE (alloc_arena (h) == 0))
return;
@@ -930,7 +930,8 @@ void BV (clib_bihash_foreach_key_value_pair)
if (BV (clib_bihash_is_free) (&v->kvp[k]))
continue;
- (*fp) (&v->kvp[k], arg);
+ if (BIHASH_WALK_STOP == cb (&v->kvp[k], arg))
+ return;
/*
* In case the callback deletes the last entry in the bucket...
*/