aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergey Kostanbaev <sergey.kostanbaev@gmail.com>2015-10-28 13:29:09 +0300
committerHarald Welte <laforge@gnumonks.org>2018-01-17 10:45:38 +0000
commit04ee9c04f492d8d1f7800e54b92f20609293ade7 (patch)
tree784366a86b60c43c90c6b1188a3c5621e5803c94 /src
parentd00a43f1487f4830edb9caf8f5b8f702eb0dec0a (diff)
gsm0480: skip length check for 'RELEASE COMPLETE' message
According to GSM 04.80 Section 2.5 'Release complete' Table 2.5, the 'RELEASE COMPLETE' message payload is optional, so let's drop the length check in gsm0480_decode_ss_request() for this type. Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsm0480.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 71470e54..d7c29787 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -249,11 +249,18 @@ int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len,
int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len,
struct ss_request *req)
{
+ uint8_t msg_type = hdr->msg_type & 0x3F;
int rc = 0;
- if (len < sizeof(*hdr) + 2) {
- LOGP(0, LOGL_DEBUG, "SS Request is too short.\n");
- return 0;
+ /**
+ * GSM 04.80 Section 2.5 'Release complete' Table 2.5
+ * payload is optional for 'RELEASE COMPLETE' message
+ */
+ if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) {
+ if (len < sizeof(*hdr) + 2) {
+ LOGP(0, LOGL_DEBUG, "SS Request is too short.\n");
+ return 0;
+ }
}
if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {