Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3311

to look at the new patch set (#5).

IuPS: don't require an MM context for Iu Release

Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3
---
M src/gprs/gprs_gmm.c
1 file changed, 13 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/3311/5

diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index dfec604..83b1a70 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -180,25 +180,33 @@
        int rc = -1;
 
        mm = sgsn_mm_ctx_by_ue_ctx(ctx);
-       if (!mm) {
-               LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event 
%i!\n", type);
-               return rc;
+
+#define REQUIRE_MM \
+       if (!mm) { \
+               LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event 
%d\n", type); \
+               return rc; \
        }
 
        switch (type) {
        case IU_EVENT_RAB_ASSIGN:
+               REQUIRE_MM
                rc = sgsn_ranap_rab_ass_resp(mm, 
(RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
                break;
        case IU_EVENT_IU_RELEASE:
                /* fall thru */
        case IU_EVENT_LINK_INVALIDATED:
                /* Clean up ue_conn_ctx here */
-               LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
-               if (mm->pmm_state == PMM_CONNECTED)
+               if (mm)
+                       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);
                rc = 0;
                break;
        case IU_EVENT_SECURITY_MODE_COMPLETE:
+               REQUIRE_MM
                /* Continue authentication here */
                mm->iu.ue_ctx->integrity_active = 1;
                rc = gsm48_gmm_authorize(mm);

-- 
To view, visit https://gerrit.osmocom.org/3311
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3
Gerrit-PatchSet: 5
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to