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
This commit is contained in:
parent
5598aaef23
commit
4a5cfa559a
|
@ -60,11 +60,10 @@ int gsm0911_rcv_nc_ss(struct ran_conn *conn, struct msgb *msg)
|
||||||
struct msgb *gsup_msgb;
|
struct msgb *gsup_msgb;
|
||||||
uint16_t facility_ie_len;
|
uint16_t facility_ie_len;
|
||||||
uint8_t *facility_ie;
|
uint8_t *facility_ie;
|
||||||
uint8_t pdisc, tid;
|
uint8_t tid;
|
||||||
uint8_t msg_type;
|
uint8_t msg_type;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
pdisc = gsm48_hdr_pdisc(gh);
|
|
||||||
msg_type = gsm48_hdr_msg_type(gh);
|
msg_type = gsm48_hdr_msg_type(gh);
|
||||||
tid = gsm48_hdr_trans_id_flip_ti(gh);
|
tid = gsm48_hdr_trans_id_flip_ti(gh);
|
||||||
|
|
||||||
|
@ -72,10 +71,10 @@ int gsm0911_rcv_nc_ss(struct ran_conn *conn, struct msgb *msg)
|
||||||
log_set_context(LOG_CTX_VLR_SUBSCR, conn->vsub);
|
log_set_context(LOG_CTX_VLR_SUBSCR, conn->vsub);
|
||||||
|
|
||||||
DEBUGP(DMM, "Received SS/USSD data (trans_id=%x, msg_type=%s)\n",
|
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 */
|
/* 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) {
|
if (!trans) {
|
||||||
/* Count MS-initiated attempts to establish a NC SS/USSD session */
|
/* 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]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS]);
|
||||||
|
@ -91,7 +90,7 @@ int gsm0911_rcv_nc_ss(struct ran_conn *conn, struct msgb *msg)
|
||||||
if (msg_type != GSM0480_MTYPE_REGISTER) {
|
if (msg_type != GSM0480_MTYPE_REGISTER) {
|
||||||
LOGP(DMM, LOGL_ERROR, "Unexpected message (msg_type=%s), "
|
LOGP(DMM, LOGL_ERROR, "Unexpected message (msg_type=%s), "
|
||||||
"transaction is not allocated yet\n",
|
"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_tx_simple(conn,
|
||||||
GSM48_PDISC_NC_SS | (tid << 4),
|
GSM48_PDISC_NC_SS | (tid << 4),
|
||||||
GSM0480_MTYPE_RELEASE_COMPLETE);
|
GSM0480_MTYPE_RELEASE_COMPLETE);
|
||||||
|
@ -100,7 +99,7 @@ int gsm0911_rcv_nc_ss(struct ran_conn *conn, struct msgb *msg)
|
||||||
|
|
||||||
DEBUGP(DMM, " -> (new transaction)\n");
|
DEBUGP(DMM, " -> (new transaction)\n");
|
||||||
trans = trans_alloc(conn->network, conn->vsub,
|
trans = trans_alloc(conn->network, conn->vsub,
|
||||||
pdisc, tid, new_callref++);
|
GSM48_PDISC_NC_SS, tid, new_callref++);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
DEBUGP(DMM, " -> No memory for trans\n");
|
DEBUGP(DMM, " -> No memory for trans\n");
|
||||||
gsm48_tx_simple(conn,
|
gsm48_tx_simple(conn,
|
||||||
|
|
Loading…
Reference in New Issue