Change in osmo-sgsn[master]: sgsn_delete_pdp_ctx: Add documentation and assert assumptions

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Fri Oct 23 11:27:30 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/20842 )


Change subject: sgsn_delete_pdp_ctx: Add documentation and assert assumptions
......................................................................

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
---
M src/sgsn/sgsn_libgtp.c
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/42/20842/1

diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 8081492..367570d 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -312,11 +312,16 @@
 	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);
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/20842
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4248e2e9846fec5ae2c8557384da2deb86668c50
Gerrit-Change-Number: 20842
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201023/5958ea68/attachment.htm>


More information about the gerrit-log mailing list