[PATCH] osmo-sgsn[master]: Use connection id when allocating rate counters

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Wed Dec 20 10:40:48 UTC 2017


Review at  https://gerrit.osmocom.org/5523

Use connection id when allocating rate counters

Due to recent libosmocore's change we can't allocate rate counters with
the same name and index which are already allocated. This causes
sgsn_mm_ctx_alloc_iu() failure for multiple subscribers.

Fix this by using conn_id parameter from ranap_ue_conn_ctx.

Change-Id: I1062ffdcac96c82269cab6f4e7ae50e28dc3aa44
Related: OS#2757
---
M src/gprs/gprs_sgsn.c
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/23/5523/1

diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 768d953..c4321f9 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -255,21 +255,23 @@
 {
 #if BUILD_IU
 	struct sgsn_mm_ctx *ctx;
+	struct ranap_ue_conn_ctx *ue_ctx = uectx;
 
 	ctx = talloc_zero(tall_bsc_ctx, struct sgsn_mm_ctx);
 	if (!ctx)
 		return NULL;
 
 	ctx->ran_type = MM_CTX_T_UTRAN_Iu;
-	ctx->iu.ue_ctx = uectx;
+	ctx->iu.ue_ctx = ue_ctx;
 	ctx->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc;
 	ctx->iu.new_key = 1;
 	ctx->gmm_state = GMM_DEREGISTERED;
 	ctx->pmm_state = PMM_DETACHED;
 	ctx->auth_triplet.key_seq = GSM_KEY_SEQ_INVAL;
-	ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0);
+	ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, ue_ctx->conn_id);
 	if (!ctx->ctrg) {
-		LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n");
+		LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group for %s.%u\n",
+			  mmctx_ctrg_desc.group_name_prefix, ue_ctx->conn_id);
 		talloc_free(ctx);
 		return NULL;
 	}

-- 
To view, visit https://gerrit.osmocom.org/5523
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1062ffdcac96c82269cab6f4e7ae50e28dc3aa44
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list