summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/bihash_template.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c
index 8a6fa16389b..41d7c7ce1d6 100644
--- a/src/vppinfra/bihash_template.c
+++ b/src/vppinfra/bihash_template.c
@@ -653,9 +653,16 @@ void BV (clib_bihash_foreach_key_value_pair)
continue;
(*fp) (&v->kvp[k], arg);
+ /*
+ * In case the callback deletes the last entry in the bucket...
+ */
+ if (BV (clib_bihash_bucket_is_empty) (b))
+ goto doublebreak;
}
v++;
}
+ doublebreak:
+ ;
}
}