diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-07-17 12:42:12 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-07-19 12:24:00 +0200 |
commit | 03dc773e081c608524a0907cb1d867f792156157 (patch) | |
tree | a9dec716703a9085c402c39e12fb3160cd5fdbdc /src/gprs/sgsn_libgtp.c | |
parent | c6cef69eef48a9846bd89ea5cca516a70fa894b5 (diff) |
sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally
Previous API freed the ctx immediatelly after sending the packet, which
triggered a call to cb_delete_context() and dropped the entire
sgsn_pdp_ctx before the PDP DEL CTX ACCEPT was received. This new API
won't free the pdp ctx and we can tear down everything once we receive
the ACCEPT in cb_conf.
cb_conf is not automatically freed at cb_conf, user needs to free it, so
we need to remove setting pctx->lib to NULL in cb_conf to avoid leaking the
pdp ctx, as it needs to be freed inside sgsn_pdp_ctx_free().
Depends: osmo-ggsn (libgtp) Change-Id I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c.
Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3
Diffstat (limited to 'src/gprs/sgsn_libgtp.c')
-rw-r--r-- | src/gprs/sgsn_libgtp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 23b881100..38133971b 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -314,10 +314,10 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn, /* SGSN wants to delete a PDP context */ int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx) { - LOGPDPCTXP(LOGL_ERROR, pctx, "Delete PDP Context\n"); + LOGPDPCTXP(LOGL_INFO, pctx, "Delete PDP Context\n"); /* FIXME: decide if we need teardown or not ! */ - return gtp_delete_context_req(pctx->ggsn->gsn, pctx->lib, pctx, 1); + return gtp_delete_context_req2(pctx->ggsn->gsn, pctx->lib, pctx, 1); } struct cause_map { @@ -573,10 +573,6 @@ static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) "is not available\n"); } - /* unlink the now non-existing library handle from the pdp - * context */ - pctx->lib = NULL; - sgsn_pdp_ctx_free(pctx); return rc; |