summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-10-10 22:46:20 +0200
committerHarald Welte <laforge@gnumonks.org>2016-10-12 09:26:52 +0000
commita95ee5e6e192d274d5d2c03fbe47edbc62c38beb (patch)
treea6933f97b4afc73833e28d0509e5c366ffb755c6 /src
parented9d6da5df98538adc70aa03cb569eb9505d04b6 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsm0480.c2
1 files changed, 1 insertions, 1 deletions
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: