Max has uploaded this change for review. ( https://gerrit.osmocom.org/12520


Change subject: Use explicit protocol discriminator for NC SS/USSD session
......................................................................

Use explicit protocol discriminator for NC SS/USSD session

In gsm0911_rcv_nc_ss() we sometimes use pdisc parsed from msgb and
sometimes constant. This function is only called when protocol
discriminator is GSM48_PDISC_NC_SS so there's no point in parsing it
again from msgb.

Let's make it consistent and always use constant.

Change-Id: Iae40bf9906fe676ff817c709120015fca4c9e042
---
M src/libmsc/gsm_09_11.c
1 file changed, 5 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/12520/1

diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 3ee6e92..12bec9d 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -60,11 +60,10 @@
        struct msgb *gsup_msgb;
        uint16_t facility_ie_len;
        uint8_t *facility_ie;
-       uint8_t pdisc, tid;
+       uint8_t tid;
        uint8_t msg_type;
        int rc;

-       pdisc = gsm48_hdr_pdisc(gh);
        msg_type = gsm48_hdr_msg_type(gh);
        tid = gsm48_hdr_trans_id_flip_ti(gh);

@@ -72,10 +71,10 @@
        log_set_context(LOG_CTX_VLR_SUBSCR, conn->vsub);

        DEBUGP(DMM, "Received SS/USSD data (trans_id=%x, msg_type=%s)\n",
-               tid, gsm48_pdisc_msgtype_name(pdisc, msg_type));
+               tid, gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, msg_type));

        /* Reuse existing transaction, or create a new one */
-       trans = trans_find_by_id(conn, pdisc, tid);
+       trans = trans_find_by_id(conn, GSM48_PDISC_NC_SS, tid);
        if (!trans) {
                /* Count MS-initiated attempts to establish a NC SS/USSD 
session */
                
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS]);
@@ -91,7 +90,7 @@
                if (msg_type != GSM0480_MTYPE_REGISTER) {
                        LOGP(DMM, LOGL_ERROR, "Unexpected message 
(msg_type=%s), "
                                "transaction is not allocated yet\n",
-                               gsm48_pdisc_msgtype_name(pdisc, msg_type));
+                               gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, 
msg_type));
                        gsm48_tx_simple(conn,
                                GSM48_PDISC_NC_SS | (tid << 4),
                                GSM0480_MTYPE_RELEASE_COMPLETE);
@@ -100,7 +99,7 @@

                DEBUGP(DMM, " -> (new transaction)\n");
                trans = trans_alloc(conn->network, conn->vsub,
-                       pdisc, tid, new_callref++);
+                                   GSM48_PDISC_NC_SS, tid, new_callref++);
                if (!trans) {
                        DEBUGP(DMM, " -> No memory for trans\n");
                        gsm48_tx_simple(conn,

--
To view, visit https://gerrit.osmocom.org/12520
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae40bf9906fe676ff817c709120015fca4c9e042
Gerrit-Change-Number: 12520
Gerrit-PatchSet: 1
Gerrit-Owner: Max <[email protected]>

Reply via email to