libmsc/gsm_04_11.c: also assign SM-RP-MR to MO transactions

Previously, SM-RP Message Reference was assigned to MT transactions
only, but not to MO transactions. As a result, this could lead to
having a few transactions with duplicate SM-RP-MR value, because
in case of MO SMS, trans->sms.sm_rp_mr would remain 0x00.

Let's parse SM-RP-MR from MO SMS messages in gsm0411_rcv_sms(),
and assign it to the new transaction after allocation.

Change-Id: I4d07354175444f9764fb0dd6ea188a64494d79fe
This commit is contained in:
Vadim Yanitskiy 2019-01-23 23:34:31 +07:00
parent 36c44b2100
commit cfd058dbf1
1 changed files with 2 additions and 0 deletions

View File

@ -1179,6 +1179,7 @@ int gsm0411_rcv_sms(struct ran_conn *conn,
struct gsm48_hdr *gh = msgb_l3(msg);
uint8_t msg_type = gh->msg_type;
uint8_t transaction_id = gsm48_hdr_trans_id_flip_ti(gh);
struct gsm411_rp_hdr *rph = (struct gsm411_rp_hdr *) gh->data;
struct gsm_trans *trans;
int new_trans = 0;
int rc = 0;
@ -1210,6 +1211,7 @@ int gsm0411_rcv_sms(struct ran_conn *conn,
return -ENOMEM;
}
trans->sms.sm_rp_mr = rph->msg_ref; /* SM-RP Message Reference */
trans->dlci = OMSC_LINKID_CB(msg); /* DLCI as received from BSC */
new_trans = 1;