Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available.

Mykola Shchetinin gerrit-no-reply at lists.osmocom.org
Tue Apr 23 12:25:54 UTC 2019


Mykola Shchetinin has uploaded this change for review. ( https://gerrit.osmocom.org/13744


Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available.
......................................................................

gprs_gmm: send Service Reject when no PDP ctxs are available.

Look at PDP Context Status IE and see if MS's view of
activated/deactivated NSAPIs agrees with our view. It is checked if
there are any Active NSAPIs in PDP Context Status IE which are not
present on the network side. If there are any then Service Reject with
the cause "NO PDP ACTIVATED" is sent back. This forces MS to reactivate
the PDP contexts.

3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted
by the network. Cause # 40.

Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
Relates: OS#3973
---
M src/gprs/gprs_gmm.c
1 file changed, 30 insertions(+), 0 deletions(-)



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

diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index 358bff9..a237da3 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -1616,6 +1616,26 @@
 	}
 }
 
+/* Returns false if any active PDP context in pdp_status is not present in the pdp_list for given MS */
+static bool all_ms_ctx_present_on_sgsn(struct sgsn_mm_ctx *mmctx,
+				       const uint8_t *pdp_status)
+{
+	uint8_t pdp_nsapi;
+
+	for (pdp_nsapi = 0; pdp_nsapi < 16; pdp_nsapi++) {
+		bool active;
+		if (pdp_nsapi < 8)
+			active = (1 << pdp_nsapi) & pdp_status[0];
+		else
+			active = (1 << (pdp_nsapi - 8)) & pdp_status[1];
+
+		if (active && (sgsn_pdp_ctx_by_nsapi(mmctx, pdp_nsapi) == NULL))
+			return false;
+	}
+
+	return true;
+}
+
 /* Chapter 9.4.14: Routing area update request */
 static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
 				   struct gprs_llc_llme *llme)
@@ -1902,6 +1922,16 @@
 	if (TLVP_PRESENT(&tp, GSM48_IE_GMM_PDP_CTX_STATUS)) {
 		const uint8_t *pdp_status = TLVP_VAL(&tp, GSM48_IE_GMM_PDP_CTX_STATUS);
 		process_ms_ctx_status(ctx, pdp_status);
+
+		/* 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not
+		 * accepted by the network. Cause #40.
+		 * If MS has PDP Contexts in Active state in pdp_status but they
+		 * are not activated on the network side then Reject with the
+		 * cause will force the mobile to recreate PDP contexts */
+		if (!all_ms_ctx_present_on_sgsn(ctx, pdp_status)) {
+			reject_cause = GMM_CAUSE_NO_PDP_ACTIVATED;
+			goto rejected;
+		}
 	}
 
 

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
Gerrit-Change-Number: 13744
Gerrit-PatchSet: 1
Gerrit-Owner: Mykola Shchetinin <mykola at pentonet.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190423/4d753c26/attachment.html>


More information about the gerrit-log mailing list