Change in ...osmocom-bb[master]: mobile/gsm480_ss.c: gsm480_tx_release_compl(): fix cause IE encoding

laforge gerrit-no-reply at lists.osmocom.org
Sun Jul 21 11:00:44 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14860 )

Change subject: mobile/gsm480_ss.c: gsm480_tx_release_compl(): fix cause IE encoding
......................................................................

mobile/gsm480_ss.c: gsm480_tx_release_compl(): fix cause IE encoding

According to GSM TS 04.08, section 10.5.4.11, location and coding
standard are encoded before the cause value, not vice-versa!

Also, coding standards other than "1 1 - Standard defined for the
GSM PLMNs" shall not be used if the cause can be represented with
the GSM standardized coding.

Change-Id: Ic6abcfb9a9589f5b0c9c40def863f15ae04d0bdd
---
M src/host/layer23/src/mobile/gsm480_ss.c
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/host/layer23/src/mobile/gsm480_ss.c b/src/host/layer23/src/mobile/gsm480_ss.c
index b114aa6..52e43b9 100644
--- a/src/host/layer23/src/mobile/gsm480_ss.c
+++ b/src/host/layer23/src/mobile/gsm480_ss.c
@@ -397,12 +397,17 @@
 	gh->proto_discr = GSM48_PDISC_NC_SS | (trans->transaction_id << 4);
 	gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
 
+	/* GSM 04.08, section 10.5.4.11 */
 	if (cause) {
 		uint8_t *tlv = msgb_put(msg, 4);
 		tlv[0] = GSM48_IE_CAUSE;
 		tlv[1] = 2;
-		tlv[2] = 0x80 | cause;
-		tlv[3] = 0x80 | GSM48_CAUSE_LOC_USER;
+
+		/* Coding standard defined for the GSM PLMNs,
+		 * location - USER, cause as given by caller,
+		 * no extension, no diagnostics. */
+		tlv[2] = (1 << 7) | (0x03 << 5) | (GSM48_CAUSE_LOC_USER & 0x0f);
+		tlv[3] = (1 << 7) | cause;
 	}
 	return gsm480_to_mm(msg, trans, GSM48_MMSS_DATA_REQ);
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14860
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ic6abcfb9a9589f5b0c9c40def863f15ae04d0bdd
Gerrit-Change-Number: 14860
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190721/51b2e591/attachment.html>


More information about the gerrit-log mailing list