aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-05-15 12:12:54 +0200
committerHarald Welte <laforge@osmocom.org>2022-05-15 15:47:00 +0200
commit173bdf303be5c9f657547b5992916227cd3c1a4d (patch)
tree6cd132bdedc7b97fb9aabaf27a11aeabd08ad8d1
parentdc7d841aad8c97e83d842acbe562bbbae4ffccc7 (diff)
vlr: Split vlr_subscr_rx_imsi_detach()
The function vlr_subscr_rx_imsi_detach() implies that an explicit IMSI DETACH was received. However, that same function was called in other situations such as timer expiration or GSUP CANCEL. Let's clean this up by splitting the function into two parts. No logical change is introduced to the VLR in this patch. Change-Id: Iffc02f3062ad591ca372a3c6d866066cf63a8830
-rw-r--r--src/libvlr/vlr.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c
index fc23b370d..f98fee6ea 100644
--- a/src/libvlr/vlr.c
+++ b/src/libvlr/vlr.c
@@ -55,6 +55,8 @@
* Convenience functions
***********************************************************************/
+static int vlr_subscr_detach(struct vlr_subscr *vsub);
+
const struct value_string vlr_ciph_names[] = {
OSMO_VALUE_STRING(VLR_CIPH_NONE),
OSMO_VALUE_STRING(VLR_CIPH_A5_1),
@@ -578,7 +580,7 @@ void vlr_subscr_expire_lu(void *data)
continue;
LOGP(DVLR, LOGL_DEBUG, "%s: Location Update expired\n", vlr_subscr_name(vsub));
- vlr_subscr_rx_imsi_detach(vsub);
+ vlr_subscr_detach(vsub);
}
done:
@@ -1070,7 +1072,7 @@ static int vlr_subscr_handle_cancel_req(struct vlr_subscr *vsub,
vlr_gmm_cause_to_mm_cause(gsup_msg->cause, &gsm48_rej);
vlr_subscr_cancel_attach_fsm(vsub, fsm_cause, gsm48_rej);
- vlr_subscr_rx_imsi_detach(vsub);
+ vlr_subscr_detach(vsub);
return rc;
}
@@ -1236,8 +1238,7 @@ bool vlr_subscr_expire(struct vlr_subscr *vsub)
return false;
}
-/* See TS 23.012 version 9.10.0 4.3.2.1 "Process Detach_IMSI_VLR" */
-int vlr_subscr_rx_imsi_detach(struct vlr_subscr *vsub)
+static int vlr_subscr_detach(struct vlr_subscr *vsub)
{
/* paranoia: should any LU or PARQ FSMs still be running, stop them. */
vlr_subscr_cancel_attach_fsm(vsub, OSMO_FSM_TERM_ERROR, GSM48_REJECT_CONGESTION);
@@ -1253,6 +1254,12 @@ int vlr_subscr_rx_imsi_detach(struct vlr_subscr *vsub)
return 0;
}
+/* See TS 23.012 version 9.10.0 4.3.2.1 "Process Detach_IMSI_VLR" */
+int vlr_subscr_rx_imsi_detach(struct vlr_subscr *vsub)
+{
+ return vlr_subscr_detach(vsub);
+}
+
/* Tear down any running FSMs due to MSC connection timeout.
* Visit all vsub->*_fsm pointers and give them a queue to send a final reject
* message before the entire connection is torn down.