summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Engel <t-openbsc@tobias.org>2013-12-28 17:03:14 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-28 17:52:23 +0100
commitea730327d10ea79d50829487474d43344bad5a62 (patch)
treed41c6af95c7face71aca1da77031875e16d755d4
parentf76ed2d089acf4079828c810acb70acaa13892d7 (diff)
ussd: Reject and release unhandled SS requests/interrogation
In case the unpack of a USSD request is failing the channel would remain open and the phone would not receive a response. Simply reject the interrogation. Example interrogation: 0000 1b 7b 1c 0d a1 0b 02 01 01 02 01 0e 30 03 04 01 0010 11 7f 01 00
-rw-r--r--openbsc/src/libmsc/ussd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c
index b413c83ba..7f01eae71 100644
--- a/openbsc/src/libmsc/ussd.c
+++ b/openbsc/src/libmsc/ussd.c
@@ -51,7 +51,15 @@ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg)
memset(&req, 0, sizeof(req));
gh = msgb_l3(msg);
rc = gsm0480_decode_ussd_request(gh, msgb_l3len(msg), &req);
- if (req.text[0] == '\0') /* Release-Complete */
+ if (!rc) {
+ DEBUGP(DMM, "Unhandled SS\n");
+ rc = gsm0480_send_ussd_reject(conn, msg, &req);
+ msc_release_connection(conn);
+ return rc;
+ }
+
+ /* Release-Complete */
+ if (req.text[0] == '\0')
return 0;
if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.text)) {