Change in osmo-sgsn[master]: gtp: Delete ctx upon receive UpdateCtxResp with cause Non-existent

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
Wed Apr 21 18:13:04 UTC 2021


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


Change subject: gtp: Delete ctx upon receive UpdateCtxResp with cause Non-existent
......................................................................

gtp: Delete ctx upon receive UpdateCtxResp with cause Non-existent

Change-Id: Ic5f682a79663acc65fd364dd7a3a7cc554534414
---
M src/sgsn/sgsn_libgtp.c
1 file changed, 29 insertions(+), 0 deletions(-)



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

diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 367570d..8be7927 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -479,6 +479,33 @@
 	gtp_echo_req(ggc->gsn, ggc->gtp_version, ggc, &ggc->remote_addr);
 }
 
+/* Confirmation of a PDP Context Update */
+static int update_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
+{
+	struct sgsn_pdp_ctx *pctx = cbp;
+	int rc;
+
+	LOGPDPCTXP(LOGL_INFO, pctx, "Received Update PDP CTX CONF, cause=%d(%s)\n",
+		cause, get_value_string(gtp_cause_strs, cause));
+
+	/* 3GPP TS 29.060 "7.3.4":
+	 * "If the SGSN receives an Update PDP Context Response with a Cause
+	 * value other than "Request accepted", it shall abort the update of the
+	 * PDP context.""
+	 * "If the SGSN receives an Update PDP Context Response with
+	 * a Cause value "Non-existent", it shall delete the PDP Context."
+	 */
+	if (cause != GTPCAUSE_NON_EXIST)
+		 return 0; /* Nothing to do */
+
+	LOGPDPCTXP(LOGL_INFO, pctx, "PDP CTX we tried to update doesn't exist in "
+		   "the GGSN anymore, deleting it locally.\n");
+
+	rc = gtp_freepdp(pctx->ggsn->gsn, pctx->lib);
+	/* related mmctx is torn down in cb_delete_context called by gtp_freepdp() */
+	return rc;
+}
+
 /* Confirmation of a PDP Context Delete */
 static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
 {
@@ -577,6 +604,8 @@
 		return echo_conf(cbp, cause == EOF);
 	case GTP_CREATE_PDP_REQ:
 		return create_pdp_conf(pdp, cbp, cause);
+	case GTP_UPDATE_PDP_REQ:
+		return update_pdp_conf(pdp, cbp, cause);
 	case GTP_DELETE_PDP_REQ:
 		return delete_pdp_conf(pdp, cbp, cause);
 	default:

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ic5f682a79663acc65fd364dd7a3a7cc554534414
Gerrit-Change-Number: 23851
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/20210421/be6c577b/attachment.htm>


More information about the gerrit-log mailing list