diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-12-18 17:13:38 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-12-18 17:15:02 +0100 |
commit | d589f1dcfddb672edddc84a06f0443569ac44bcc (patch) | |
tree | a975406b8c6c773a060b812f2d7156ee334ff693 /src/rate_ctr.c | |
parent | 937ddea6cce45f3f6dcb8177ea86162f15ecb5f9 (diff) |
rate_ctr: print proper error message if rate_ctr already exists
Change-Id: I86b7ccb0931f5a2a489bb8c7c6aee0894a126eb8
Diffstat (limited to 'src/rate_ctr.c')
-rw-r--r-- | src/rate_ctr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rate_ctr.c b/src/rate_ctr.c index c27ac68e..72c6bb11 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -190,8 +190,11 @@ struct rate_ctr_group *rate_ctr_group_alloc(void *ctx, unsigned int size; struct rate_ctr_group *group; - if (rate_ctr_get_group_by_name_idx(desc->group_name_prefix, idx)) + if (rate_ctr_get_group_by_name_idx(desc->group_name_prefix, idx)) { + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' already exists for index %u\n", + desc->group_name_prefix, idx); return NULL; /* group already exist */ + } size = sizeof(struct rate_ctr_group) + desc->num_ctr * sizeof(struct rate_ctr); |