aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-04-09 16:35:01 +0200
committerHarald Welte <laforge@gnumonks.org>2018-04-09 16:41:10 +0200
commit0e2fa5dcb55f77f282f926570b6da0459bd3971c (patch)
tree0dd5b0829ebae764cbbd96066d86be3df90eade6 /src/libmsc/gsm_04_08.c
parent93c7463fcea24517ef367101609f34264570f1d0 (diff)
DTAP: Ensure proper DLCI is used in MSC-originated DTAP
The DLCI field of the DTAP header indicates the SAPI as well as the data link (main DCCH or SACCH). We must make sure to use the correct DLCI when sending DTAP to the BSC. We achieve this by * storing the DLCI in the msgb->cb while parsing the DTAP header * storing the received DLCI (from msgb->cb) in the transaction for mobile-originated transactions * using the trans->dlci to sent msgb->cb when transmitting L3 * filling the DTAP DLCI value from msgb->cb when transmitting DTAP For MSC-originated transactions, we choose a DLCI value corresponding to the service (SAPI=0 for CC, SAPI=3 for SMS) and store that in trans->dlci. Closes: OS#3150 Change-Id: If511b20f52575054cab1346d99a8cb68d827fdbf
Diffstat (limited to 'src/libmsc/gsm_04_08.c')
-rw-r--r--src/libmsc/gsm_04_08.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index a90ff172f..e5ddb44d4 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -164,6 +164,7 @@ static int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection
* work that the caller no longer has to do */
if (trans) {
gh->proto_discr = trans->protocol | (trans->transaction_id << 4);
+ OMSC_LINKID_CB(msg) = trans->dlci;
}
return msc_tx_dtap(conn, msg);
@@ -3110,6 +3111,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
/* Assign conn */
trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC);
+ trans->dlci = 0x00; /* SAPI=0, not SACCH */
vlr_subscr_put(vsub);
} else {
/* update the subscriber we deal with */
@@ -3262,6 +3264,7 @@ static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *m
}
/* Assign transaction */
trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC);
+ trans->dlci = OMSC_LINKID_CB(msg); /* DLCI as received from BSC */
cm_service_request_concludes(conn, msg);
}