aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-07-14 12:04:04 +0200
committerHarald Welte <laforge@gnumonks.org>2012-07-14 12:17:42 +0200
commit7b022eed2d211eada63d2fe1f89b02455f501b9b (patch)
tree7c89c86a438326e876b4d60acf514a8163cacbb4
parent45f9171175fba99fff594465cb85d596212b5cac (diff)
add some comments regarding the free() / release of pdp contextx
It might be that we're deleting structures instead of properly cleaning up the attached libgtp handles...
-rw-r--r--openbsc/src/gprs/gprs_gmm.c3
-rw-r--r--openbsc/src/gprs/gprs_sgsn.c5
2 files changed, 8 insertions, 0 deletions
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);
}
}