aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-12-20 11:38:01 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-26 22:22:10 +0000
commit794693c09360382a222a00b031cf5159a8088303 (patch)
tree0510acc45626d1a5e63f1bbad1a8ce537dcffa82 /src/gprs
parente9bcbe1545e115dd1f099c3d56b315b86d09083e (diff)
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
Diffstat (limited to 'src/gprs')
-rw-r--r--src/gprs/gprs_sgsn.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 768d95350..c4321f91c 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -255,21 +255,23 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx)
{
#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;
}