Skip to content

Commit

Permalink
Fix DeactPDPCtxAcc when UE goes PMM ENABLED but lost its PDP context
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pespin committed Jul 30, 2024
1 parent f8d248e commit 4ced617
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/osmocom/sgsn/pdpctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct sgsn_pdp_ctx {
//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 */
Expand Down
1 change: 1 addition & 0 deletions src/sgsn/gprs_gmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,7 @@ static void process_ms_ctx_status(struct sgsn_mm_ctx *mmctx,
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 */
Expand Down
9 changes: 6 additions & 3 deletions src/sgsn/sgsn_libgtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx)
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 */
Expand Down Expand Up @@ -567,9 +568,11 @@ static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
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 "
Expand Down

0 comments on commit 4ced617

Please sign in to comment.