From a95ee5e6e192d274d5d2c03fbe47edbc62c38beb Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 10 Oct 2016 22:46:20 +0200 Subject: fix USSD: SS message type mask should be 0x3f, not 0xbf See 04.80[1], section 3.4: the highest two bits are used as counter or ignored and do not contribute to the SS "Miscellaneous message group". Previous mask of 0xbf included the highest bit, fix to 0x3f. Observed a value of 0xbb that should mean 0x3b="Register" during testing of 3G USSD requests, which seem to be the first to send a nonzero highest bit to our code. The erratic mask of 0xbf lead to an unhandled message type of 0xbb. [1] 3GPP TS 24.080 version 7.2.0 Release 7 / ETSI TS 124 080 V7.2.0 (2006-09) Change-Id: I299001a9e36c16f55622a0acd5d4a55ca49d0055 --- src/gsm/gsm0480.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 8963b788..d628d922 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -268,7 +268,7 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) { int rc = 1; - uint8_t msg_type = hdr->msg_type & 0xBF; /* message-type - section 3.4 */ + uint8_t msg_type = hdr->msg_type & 0x3F; /* message-type - section 3.4 */ switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: -- cgit v1.2.3