daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/35353?usp=email )


Change subject: iu_client: Use local variable to track conn_id
......................................................................

iu_client: Use local variable to track conn_id

Change-Id: I967a311e2ad5af585c032426cc6b0680c3313b0f
---
M src/iu_client.c
1 file changed, 21 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/53/35353/1

diff --git a/src/iu_client.c b/src/iu_client.c
index 077ac27..9da11ea 100644
--- a/src/iu_client.c
+++ b/src/iu_client.c
@@ -819,6 +819,7 @@
        int rc = -1;
        struct ranap_ue_conn_ctx *ue;
        struct new_ue_conn_ctx new_ctx = {};
+       uint32_t conn_id;

        LOGPIU(LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph));

@@ -828,7 +829,8 @@
                break;
        case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION):
                /* indication of new inbound connection request*/
-               LOGPIU(LOGL_DEBUG, "N-CONNECT.ind(X->%u)\n", 
prim->u.connect.conn_id);
+               conn_id = prim->u.connect.conn_id;
+               LOGPIU(LOGL_DEBUG, "N-CONNECT.ind(X->%u)\n", conn_id);
                if (/*  prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP 
|| */
                    !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) {
                        LOGPIU(LOGL_NOTICE,
@@ -836,7 +838,7 @@
                        return 0;
                }
                new_ctx.sccp_addr = prim->u.connect.calling_addr;
-               new_ctx.conn_id = prim->u.connect.conn_id;
+               new_ctx.conn_id = conn_id;
                /* first ensure the local SCCP socket is ACTIVE */
                resp = make_conn_resp(&prim->u.connect);
                osmo_sccp_user_sap_down(scu, resp);
@@ -845,9 +847,9 @@
                break;
        case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION):
                /* indication of disconnect */
-               LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n",
-                      prim->u.disconnect.conn_id);
-               ue = ue_conn_ctx_find(prim->u.disconnect.conn_id);
+               conn_id = prim->u.disconnect.conn_id;
+               LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n", conn_id);
+               ue = ue_conn_ctx_find(conn_id);
                if (!ue)
                        break;

@@ -856,14 +858,14 @@
                        rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, 
msgb_l2(oph->msg), msgb_l2len(oph->msg));

                /* A Iu Release event might be used to free the UE in 
cn_ranap_handle_co. */
-               ue = ue_conn_ctx_find(prim->u.disconnect.conn_id);
+               ue = ue_conn_ctx_find(conn_id);
                if (!ue)
                        break;

                global_iu_event(ue, RANAP_IU_EVENT_LINK_INVALIDATED, NULL);

                /* A RANAP_IU_EVENT_LINK_INVALIDATED, can lead to a free */
-               ue = ue_conn_ctx_find(prim->u.disconnect.conn_id);
+               ue = ue_conn_ctx_find(conn_id);
                if (!ue)
                        break;
                if (ue->free_on_release)
@@ -871,10 +873,11 @@
                break;
        case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION):
                /* connection-oriented data received */
-               LOGPIU(LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id,
+               conn_id = prim->u.data.conn_id;
+               LOGPIU(LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", conn_id,
                       osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
                /* resolve UE context */
-               ue = ue_conn_ctx_find(prim->u.data.conn_id);
+               ue = ue_conn_ctx_find(conn_id);
                if (!ue)
                        break;


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/35353?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I967a311e2ad5af585c032426cc6b0680c3313b0f
Gerrit-Change-Number: 35353
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillm...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to