mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-26 09:33:44 +00:00
sgsn_ranap_iu_event: handle some events without valid MM context
Change-Id: Ia7e74087d56996104b6d3935b1cf12166ff67f3a
This commit is contained in:
@@ -151,25 +151,33 @@ int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *
|
|||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
|
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
|
||||||
if (!mm) {
|
|
||||||
LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %i!\n", type);
|
#define REQUIRE_MM \
|
||||||
return rc;
|
if (!mm) { \
|
||||||
|
LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %i!\n", type); \
|
||||||
|
return rc; \
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IU_EVENT_RAB_ASSIGN:
|
case IU_EVENT_RAB_ASSIGN:
|
||||||
|
REQUIRE_MM
|
||||||
rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
|
rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
|
||||||
break;
|
break;
|
||||||
case IU_EVENT_IU_RELEASE:
|
case IU_EVENT_IU_RELEASE:
|
||||||
/* fall thru */
|
/* fall thru */
|
||||||
case IU_EVENT_LINK_INVALIDATED:
|
case IU_EVENT_LINK_INVALIDATED:
|
||||||
/* Clean up ue_conn_ctx here */
|
/* Clean up ue_conn_ctx here */
|
||||||
LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
|
if (mm)
|
||||||
if (mm->pmm_state == PMM_CONNECTED)
|
LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
|
||||||
|
else
|
||||||
|
LOGMMCTXP(LOGL_INFO, mm, "IU release for UE conn 0x%x\n",
|
||||||
|
ctx->conn_id);
|
||||||
|
if (mm && mm->pmm_state == PMM_CONNECTED)
|
||||||
mmctx_set_pmm_state(mm, PMM_IDLE);
|
mmctx_set_pmm_state(mm, PMM_IDLE);
|
||||||
rc = 0;
|
rc = 0;
|
||||||
break;
|
break;
|
||||||
case IU_EVENT_SECURITY_MODE_COMPLETE:
|
case IU_EVENT_SECURITY_MODE_COMPLETE:
|
||||||
|
REQUIRE_MM
|
||||||
/* Continue authentication here */
|
/* Continue authentication here */
|
||||||
mm->iu.ue_ctx->integrity_active = 1;
|
mm->iu.ue_ctx->integrity_active = 1;
|
||||||
rc = gsm48_gmm_authorize(mm);
|
rc = gsm48_gmm_authorize(mm);
|
||||||
|
|||||||
Reference in New Issue
Block a user