aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-29 14:00:28 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-30 21:28:07 +0100
commit07f6e36ab42380f9a4c1af058c3021cb0e945dc4 (patch)
treef7567d801d32f439fc249ca8efb58d301a5123c3 /openbsc
parent8000e0ea509c5a4488a5d1878f465418d32b7fdb (diff)
gprs: Send GSUP error reply for requests without IMSI
Currently gprs_subscr_rx_gsup_message returns immediately after it detects that an IMSI has not been given in the received GSUP message. While this is ok for responses (result or error), a request should always be answered. This commit adds code to reply with a corresponding error message ("Invalid mandatory information") when it receives a request without an IMSI. Note that the generated error message will not contain an IMSI either. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index e4dda9c46..4434324ab 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -505,8 +505,14 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
return rc;
}
- if (!gsup_msg.imsi[0])
+ if (!gsup_msg.imsi[0]) {
+ LOGP(DGPRS, LOGL_ERROR, "Missing IMSI in GSUP message\n");
+
+ if (GPRS_GSUP_IS_MSGT_REQUEST(gsup_msg.message_type))
+ gprs_subscr_tx_gsup_error_reply(NULL, &gsup_msg,
+ GMM_CAUSE_INV_MAND_INFO);
return -GMM_CAUSE_INV_MAND_INFO;
+ }
subscr = gprs_subscr_get_by_imsi(gsup_msg.imsi);