aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-27 13:47:24 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-28 20:44:40 +0100
commit929acdf6bf4ef25c8cc587a6aa48651696348881 (patch)
tree05d66cd741ba836a945ecf6536ac75d687f4bf77
parente988ae471d8e699a4045d77048986570349203fa (diff)
gprs: Handle PURGE MS ERR/RES without subscr
Currently the subscr entry is no longer present, when PURGE MS ERROR/RESULT arrives. In this case, an unspecific notice is logged ('unknown IMSI'). This clutters up the logfile with notices even in perfectly normal operation. This commit changes the code path that is used when a subscr cannot be found for an incoming GSUP message. A check for PURGE MS RESULT and ERROR is added and gprs_subscr_handle_gsup_purge_no_subscr is called for these messages instead of gprs_subscr_handle_unknown_imsi. Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index 94db74259..54a61611e 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -35,6 +35,11 @@
#define SGSN_SUBSCR_MAX_RETRIES 3
#define SGSN_SUBSCR_RETRY_INTERVAL 10
+#define LOGGSUPP(level, gsup, fmt, args...) \
+ LOGP(DGPRS, level, "GSUP(%s) " fmt, \
+ (gsup)->imsi, \
+ ## args)
+
extern void *tall_bsc_ctx;
static int gsup_read_cb(struct gprs_gsup_client *gsupc, struct msgb *msg);
@@ -370,6 +375,21 @@ static int gprs_subscr_handle_gsup_upd_loc_err(struct gsm_subscriber *subscr,
return -gsup_msg->cause;
}
+static int gprs_subscr_handle_gsup_purge_no_subscr(
+ struct gprs_gsup_message *gsup_msg)
+{
+ if (GPRS_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) {
+ LOGGSUPP(LOGL_NOTICE, gsup_msg,
+ "Purge MS has failed with cause '%s' (%d)\n",
+ get_value_string(gsm48_gmm_cause_names, gsup_msg->cause),
+ gsup_msg->cause);
+ return -gsup_msg->cause;
+ }
+
+ LOGGSUPP(LOGL_INFO, gsup_msg, "Completing purge MS\n");
+ return 0;
+}
+
static int gprs_subscr_handle_gsup_purge_res(struct gsm_subscriber *subscr,
struct gprs_gsup_message *gsup_msg)
{
@@ -479,8 +499,15 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
subscr = gprs_subscr_get_by_imsi(gsup_msg.imsi);
- if (!subscr)
- return gprs_subscr_handle_unknown_imsi(&gsup_msg);
+ if (!subscr) {
+ switch (gsup_msg.message_type) {
+ case GPRS_GSUP_MSGT_PURGE_MS_RESULT:
+ case GPRS_GSUP_MSGT_PURGE_MS_ERROR:
+ return gprs_subscr_handle_gsup_purge_no_subscr(&gsup_msg);
+ default:
+ return gprs_subscr_handle_unknown_imsi(&gsup_msg);
+ }
+ }
LOGGSUBSCRP(LOGL_INFO, subscr,
"Received GSUP message of type 0x%02x\n", gsup_msg.message_type);