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...
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 0ed7162..72d9e76 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -604,6 +604,9 @@
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 d8da846..0d8fe50 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/src/gprs/gprs_sgsn.c
@@ -173,6 +173,8 @@
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 @@
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 @@
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 @@
/* 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);
}
}