laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38002?usp=email )
Change subject: Revert "hnb_persistent: Use incrementing counter for rate_ctr + stat_item index" ......................................................................
Revert "hnb_persistent: Use incrementing counter for rate_ctr + stat_item index"
This reverts commit 61e278a452bf4fd240e45f1fe8c094a4b3795317 as it created errors in our test suite. Let's live with the cosmetic error message but have working tests instead. We should probably consider removing the printing of the message from libosmocore, at least in case the counters also have names set?
Closes: OS#6557 Change-Id: I2f7d3f3c88775e2926661e4760ec1d8723c0400c --- M src/osmo-hnbgw/hnbgw.c 1 file changed, 2 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/02/38002/1
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c index 90b8147..d4515a8 100644 --- a/src/osmo-hnbgw/hnbgw.c +++ b/src/osmo-hnbgw/hnbgw.c @@ -497,22 +497,19 @@ osmo_timer_schedule(&hnbp->disconnected_timeout, period_s, 0); }
-static unsigned int g_hnbp_ctr_id; - struct hnb_persistent *hnb_persistent_alloc(const struct umts_cell_id *id) { struct hnb_persistent *hnbp = talloc_zero(g_hnbgw, struct hnb_persistent); - unsigned int ctr_id = g_hnbp_ctr_id++; if (!hnbp) return NULL;
hnbp->id = *id; hnbp->id_str = talloc_strdup(hnbp, umts_cell_id_to_str(id)); - hnbp->ctrs = rate_ctr_group_alloc(hnbp, &hnb_ctrg_desc, ctr_id); + hnbp->ctrs = rate_ctr_group_alloc(hnbp, &hnb_ctrg_desc, 0); if (!hnbp->ctrs) goto out_free; rate_ctr_group_set_name(hnbp->ctrs, hnbp->id_str); - hnbp->statg = osmo_stat_item_group_alloc(hnbp, &hnb_statg_desc, ctr_id); + hnbp->statg = osmo_stat_item_group_alloc(hnbp, &hnb_statg_desc, 0); if (!hnbp->statg) goto out_free_ctrs; osmo_stat_item_group_set_name(hnbp->statg, hnbp->id_str);