pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/37636?usp=email )
Change subject: Fix DeactPDPCtxAcc when UE goes PMM ENABLED but lost its PDP context
......................................................................
Fix DeactPDPCtxAcc when UE goes PMM ENABLED but lost its PDP context
Scenario: UE activates a PDP context, then after a while goes PMM IDLE
(Iu conn is destroyed but PDP is kept).
When UE connects through Iu again, it sends eg. RAU or ServiceRequest
with pdp_status bitmask statis the active NSAPIs.
If some NSAPI (PDP context) is enabled at SGSN but doesn't show up in
the bitmask, SGSN will destroy the PDP context with GGSN
(DeletePDPContextReq) towards GGSN prior to re-creating it.
When SGSN receives the DeletePDPContextResp, it would forward a
DeactivatePDPContextReq to the UE for a PDP context which was not known
by the UE anymore, this is wrong.
With this patch, the state of the NSAPI/PDP at the UE side is tracked,
and used to know whether when the PDP gets deleted on the GGSN side then
it needs to also be deleted on the Iu side.
Change-Id: I0ccd9228d71c29248b5f510356dbfdb09565dc30
---
M include/osmocom/sgsn/pdpctx.h
M src/sgsn/gprs_gmm.c
M src/sgsn/sgsn_libgtp.c
3 files changed, 32 insertions(+), 3 deletions(-)
Approvals:
lynxis lazus: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h
index 255a77d..f3cf0ed 100644
--- a/include/osmocom/sgsn/pdpctx.h
+++ b/include/osmocom/sgsn/pdpctx.h
@@ -68,6 +68,7 @@
//uint32_t qos_profile_neg;
uint8_t radio_prio;
//uint32_t charging_id;
+ bool ue_pdp_active; /* PDP Context is active for this NSAPI? */
struct osmo_timer_list timer;
unsigned int T; /* Txxxx number */
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index 653c425..ab8b7ef 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -1591,6 +1591,7 @@
LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u "
"due to PDP CTX STATUS IE=0x%02x%02x\n",
pdp->nsapi, pdp_status[1], pdp_status[0]);
+ pdp->ue_pdp_active = false;
if (pdp->ggsn)
sgsn_delete_pdp_ctx(pdp);
else /* GTP side already detached, freeing */
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 9edd0c6..4885ada 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -378,6 +378,7 @@
rc = gsm48_tx_gsm_act_pdp_acc(pctx);
if (rc < 0)
return rc;
+ pctx->ue_pdp_active = true;
if (pctx->mm->ran_type == MM_CTX_T_GERAN_Gb) {
/* Send SNDCP XID to MS */
@@ -567,9 +568,11 @@
return -ENOTSUP;
#endif
}
-
- /* Confirm deactivation of PDP context to MS */
- rc = gsm48_tx_gsm_deact_pdp_acc(pctx);
+ if (pctx->ue_pdp_active) {
+ /* Confirm deactivation of PDP context to MS */
+ rc = gsm48_tx_gsm_deact_pdp_acc(pctx);
+ pctx->ue_pdp_active = false;
+ }
} else {
LOGPDPCTXP(LOGL_NOTICE, pctx,
"Not deactivating SNDCP layer since the MM context "
--
To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/37636?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I0ccd9228d71c29248b5f510356dbfdb09565dc30
Gerrit-Change-Number: 37636
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged