aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/perfmon
diff options
context:
space:
mode:
authorRay Kinsella <mdr@ashroe.eu>2022-01-28 04:59:00 +0000
committerDamjan Marion <dmarion@me.com>2022-01-30 15:08:18 +0000
commit0a0e711cce0f29012ceb6bcde732c072415c2f96 (patch)
treefa02cf1d420f7f9c1643e211cae14f3373446a66 /src/plugins/perfmon
parentfdb5a5a0e4aad887add68985191be114dcc99e38 (diff)
perfmon: check for duplicates after other checks
Move checking for duplicate bundle names after the other checks. Type: fix Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I7fed5be758814e166eb8756b3df090130ac13bfd
Diffstat (limited to 'src/plugins/perfmon')
-rw-r--r--src/plugins/perfmon/perfmon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/perfmon/perfmon.c b/src/plugins/perfmon/perfmon.c
index 15690361a7f..594a98759c8 100644
--- a/src/plugins/perfmon/perfmon.c
+++ b/src/plugins/perfmon/perfmon.c
@@ -398,9 +398,6 @@ perfmon_init (vlib_main_t *vm)
clib_error_t *err;
uword *p;
- if (hash_get_mem (pm->bundle_by_name, b->name) != 0)
- clib_panic ("duplicate bundle name '%s'", b->name);
-
if ((p = hash_get_mem (pm->source_by_name, b->source)) == 0)
{
log_debug ("missing source '%s', skipping bundle '%s'", b->source,
@@ -426,6 +423,9 @@ perfmon_init (vlib_main_t *vm)
continue;
}
+ if (hash_get_mem (pm->bundle_by_name, b->name) != 0)
+ clib_panic ("duplicate bundle name '%s'", b->name);
+
hash_set_mem (pm->bundle_by_name, b->name, b);
log_debug ("bundle '%s' regisrtered", b->name);