summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-04 03:34:50 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-09 18:34:14 +0100
commit92ac3900a819b5f79c5ab66eaf016e7178a6f303 (patch)
tree294cae7ffbf89e2efd43b30aecedd68ae5f7b914
parente38de9dd4f2649a0c4e4a16a1f199b48d5a2d2ff (diff)
vlr: fix: don't send CM Service Accept after Ciphering Command
Ciphering Mode Command is an implicit CM Service Accept, if we're sending both we're confusing the MS. Change-Id: I3a04debe9b01c086e7f44b6139cb8796fcc71d38 Conflicts: openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.c openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err
-rw-r--r--openbsc/src/libvlr/vlr_access_req_fsm.c5
-rw-r--r--openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.c8
-rw-r--r--openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.err10
3 files changed, 12 insertions, 11 deletions
diff --git a/openbsc/src/libvlr/vlr_access_req_fsm.c b/openbsc/src/libvlr/vlr_access_req_fsm.c
index 1ccc37792..96ded2aca 100644
--- a/openbsc/src/libvlr/vlr_access_req_fsm.c
+++ b/openbsc/src/libvlr/vlr_access_req_fsm.c
@@ -81,6 +81,7 @@ struct proc_arq_priv {
enum vlr_ciph ciphering_required;
bool is_r99;
bool is_utran;
+ bool implicitly_accepted_parq_by_ciphering_cmd;
};
static void assoc_par_with_subscr(struct osmo_fsm_inst *fi, struct vlr_subscr *vsub)
@@ -125,7 +126,8 @@ static void proc_arq_vlr_dispatch_result(struct osmo_fsm_inst *fi,
* will be processed before we handle new incoming data from the MS. */
if (par->type == VLR_PR_ARQ_T_CM_SERV_REQ) {
- if (success) {
+ if (success
+ && !par->implicitly_accepted_parq_by_ciphering_cmd) {
rc = par->vlr->ops.tx_cm_serv_acc(par->msc_conn_ref);
if (rc) {
LOGPFSML(fi, LOGL_ERROR,
@@ -287,6 +289,7 @@ static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi)
return;
}
+ par->implicitly_accepted_parq_by_ciphering_cmd = true;
osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_CIPH, 0, 0);
}
diff --git a/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
index a428e94f3..6b5017b78 100644
--- a/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
+++ b/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
@@ -118,9 +118,9 @@ void test_ciph()
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
- btw("MS sends Ciphering Mode Complete, VLR accepts and sends CM Service Accept");
+ btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept");
ms_sends_msg("0632");
- VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
+ VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("a USSD request is serviced");
dtap_expect_tx_ussd("Your extension is 46071\r");
@@ -349,9 +349,9 @@ void test_ciph_tmsi()
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
- btw("MS sends Ciphering Mode Complete, VLR accepts and sends CM Service Accept");
+ btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept");
ms_sends_msg("0632");
- VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
+ VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
btw("a USSD request is serviced");
dtap_expect_tx_ussd("Your extension is 46071\r");
diff --git a/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
index 45b9ccb3f..8672418ea 100644
--- a/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
+++ b/openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
@@ -225,7 +225,7 @@ DRLL Dispatching 04.08 message, pdisc=6
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19
DRLL Dispatching 04.08 message, pdisc=9
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01
-- MS sends Ciphering Mode Complete, VLR accepts and sends CM Service Accept
+- MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept
rx from MS: pdisc=0x06 msg_type=0x32
DRR MSISDN:46071: CIPHERING MODE COMPLETE
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES
@@ -237,13 +237,12 @@ DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED)
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED
-- sending CM Service Accept for MSISDN:46071
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP
- cm_service_result_sent == 1
+ cm_service_result_sent == 0
- a USSD request is serviced
expecting USSD:
Your extension is 46071
@@ -700,7 +699,7 @@ DRLL Dispatching 04.08 message, pdisc=6
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19
DRLL Dispatching 04.08 message, pdisc=9
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01
-- MS sends Ciphering Mode Complete, VLR accepts and sends CM Service Accept
+- MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept
rx from MS: pdisc=0x06 msg_type=0x32
DRR MSISDN:46071: CIPHERING MODE COMPLETE
DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES
@@ -712,13 +711,12 @@ DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_pos
DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED)
DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE
DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED
-- sending CM Service Accept for MSISDN:46071
DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED
DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ
DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED
DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true
DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP
- cm_service_result_sent == 1
+ cm_service_result_sent == 0
- a USSD request is serviced
expecting USSD:
Your extension is 46071