diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 0ed716290..72d9e764b 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -604,6 +604,9 @@ static int gsm48_rx_gmm_id_resp(struct sgsn_mm_ctx *ctx, struct msgb *msg) ictx->p_tmsi, ctx->p_tmsi); gprs_llgmm_assign(ictx->llme, ictx->tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + /* FIXME: this is a hard free, we don't + * clean-up any PDP contexts on the + * libgtp side */ sgsn_mm_ctx_free(ictx); } } diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index d8da84661..0d8fe50ef 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -173,6 +173,8 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc(uint32_t tlli, return ctx; } +/* this is a hard _free_ function, it doesn't clean up the PDP contexts + * in libgtp! */ void sgsn_mm_ctx_free(struct sgsn_mm_ctx *mm) { struct sgsn_pdp_ctx *pdp, *pdp2; @@ -215,6 +217,7 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm, return NULL; } +/* you don't want to use this directly, call sgsn_create_pdp_ctx() */ struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, uint8_t nsapi) { @@ -237,6 +240,7 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, return pdp; } +/* you probably want to call sgsn_delete_pdp_ctx() instead */ void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp) { rate_ctr_group_free(pdp->ctrg); @@ -359,6 +363,7 @@ static void drop_one_pdp(struct sgsn_pdp_ctx *pdp) /* FIXME: GPRS paging in case MS is SUSPENDED */ LOGP(DGPRS, LOGL_NOTICE, "Hard-dropping PDP ctx due to GGSN " "recovery\n"); + /* FIXME: how to tell this to libgtp? */ sgsn_pdp_ctx_free(pdp); } }