From 60581ae7c9a8bf2ee6ba9c7efa567a3b207d7161 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 23 Oct 2020 13:03:58 +0200 Subject: sgsn_delete_pdp_ctx: Add documentation and assert assumptions This function is only expected to be called if the GTP side of the PDP ctx is still alive, since it will tear down the GTP side and then finish the pending MS side if needed. The asserts are added to ease debugging since it was noted that a few callers were using this function without properly checking the status of the pdp ctx. Related: OS#4817 Change-Id: I4248e2e9846fec5ae2c8557384da2deb86668c50 --- src/sgsn/sgsn_libgtp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index 808149244..367570d3e 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -312,11 +312,16 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn, return pctx; } -/* SGSN wants to delete a PDP context */ +/* SGSN wants to delete a PDP context, send first DeleteCtxReq on the GTP side, + then upon DeleteCtx ACK it will send DeactPdpAcc to the MS if still + connected. */ int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx) { LOGPDPCTXP(LOGL_INFO, pctx, "Delete PDP Context\n"); + OSMO_ASSERT(pctx->ggsn); + OSMO_ASSERT(pctx->lib); + /* FIXME: decide if we need teardown or not ! */ return gtp_delete_context_req2(pctx->ggsn->gsn, pctx->lib, pctx, 1); } -- cgit v1.2.3