aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-08 15:29:01 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-19 08:30:01 +0100
commit244aeadb616702b34d479be3872a5e1bf71120b0 (patch)
treeb2654793730ca9af015a69b796c2a09886ead89f /openbsc/src/gprs
parent10a8847d671260da5d94d76c5751424f2f367a0e (diff)
gprs: Support the full cancellation procedure
Currently no GSUP LocationCancellationResult message is sent back to the peer (HLR), if the procedure succeeded at the SGSN's side. This patch adds the missing message and put the whole request handling of this procedure into a separate function. Ticket: OW#1338 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index 271cc7832..a30729d4d 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -490,6 +490,22 @@ static int gprs_subscr_handle_gsup_purge_err(struct gsm_subscriber *subscr,
return -gsup_msg->cause;
}
+static int gprs_subscr_handle_loc_cancel_req(struct gsm_subscriber *subscr,
+ struct gprs_gsup_message *gsup_msg)
+{
+ struct gprs_gsup_message gsup_reply = {0};
+
+ LOGGSUBSCRP(LOGL_INFO, subscr, "purging MS subscriber\n");
+
+ gsup_reply.message_type = GPRS_GSUP_MSGT_LOCATION_CANCEL_RESULT;
+ gprs_subscr_tx_gsup_message(subscr, &gsup_reply);
+
+ subscr->sgsn_data->error_cause = 0;
+ gprs_subscr_put_and_cancel(subscr_get(subscr));
+
+ return 0;
+}
+
static int gprs_subscr_handle_unknown_imsi(struct gprs_gsup_message *gsup_msg)
{
if (GPRS_GSUP_IS_MSGT_REQUEST(gsup_msg->message_type)) {
@@ -546,9 +562,7 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
switch (gsup_msg.message_type) {
case GPRS_GSUP_MSGT_LOCATION_CANCEL_REQUEST:
- subscr->sgsn_data->error_cause = 0;
- gprs_subscr_put_and_cancel(subscr);
- subscr = NULL;
+ rc = gprs_subscr_handle_loc_cancel_req(subscr, &gsup_msg);
break;
case GPRS_GSUP_MSGT_SEND_AUTH_INFO_RESULT:
@@ -596,8 +610,7 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
break;
};
- if (subscr)
- subscr_put(subscr);
+ subscr_put(subscr);
return rc;
}