Change in osmo-sgsn[master]: Forward GGSN originated DEACT PDP CTX REQ

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jul 16 17:53:45 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10002 )

Change subject: Forward GGSN originated DEACT PDP CTX REQ
......................................................................

Forward GGSN originated DEACT PDP CTX REQ

This commit fixes TTCN3 sgsn test TC_attach_pdp_act_user_deact_mt.

Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954
---
M include/osmocom/sgsn/gprs_sgsn.h
M src/gprs/gprs_sgsn.c
M src/gprs/sgsn_libgtp.c
3 files changed, 15 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 5f30889..8eba2d4 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -361,6 +361,7 @@
 struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id);
 struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr);
 struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id);
+void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx);
 int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn);
 void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp);
 void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp);
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index ef0cc23..e6d88e3 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -699,17 +699,17 @@
 	return GSM_RESERVED_TMSI;
 }
 
-static void drop_one_pdp(struct sgsn_pdp_ctx *pdp)
+void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx)
 {
-	if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) {
-		gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true);
-		sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp);
+	if (pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) {
+		gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true);
+		sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx);
 	} else  {
 		/* FIXME: GPRS paging in case MS is SUSPENDED */
-		LOGPDPCTXP(LOGL_NOTICE, pdp, "Hard-dropping PDP ctx due to GGSN "
+		LOGPDPCTXP(LOGL_NOTICE, pctx, "Hard-dropping PDP ctx due to GGSN "
 			"recovery\n");
 		/* FIXME: how to tell this to libgtp? */
-		sgsn_pdp_ctx_free(pdp);
+		sgsn_pdp_ctx_free(pctx);
 	}
 }
 
@@ -721,7 +721,7 @@
 
 	struct sgsn_pdp_ctx *pdp, *pdp2;
 	llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) {
-		drop_one_pdp(pdp);
+		sgsn_ggsn_ctx_drop_pdp(pdp);
 		num++;
 	}
 
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index 88cea5d..659392e 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -639,8 +639,15 @@
 /* Called whenever a PDP context is deleted for any reason */
 static int cb_delete_context(struct pdp_t *pdp)
 {
+	struct sgsn_pdp_ctx *pctx = pdp->priv;
+
 	LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context %p was deleted\n", pdp);
 
+	/* unlink the now non-existing library handle from the pdp
+	 * context */
+	pctx->lib = NULL;
+
+	sgsn_ggsn_ctx_drop_pdp(pctx);
 	return 0;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/10002
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954
Gerrit-Change-Number: 10002
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180716/adc35700/attachment.htm>


More information about the gerrit-log mailing list