Change in libosmocore[master]: gsm0808_utils: Fix gsm0808_cause_class() function

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

ipse gerrit-no-reply at lists.osmocom.org
Tue May 12 21:46:18 UTC 2020


ipse has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/18230 )


Change subject: gsm0808_utils: Fix gsm0808_cause_class() function
......................................................................

gsm0808_utils: Fix gsm0808_cause_class() function

Cause class is in bits 5-7 of the cause value.
For the cause value 0x52 old version returned 0xa instead of
a correct 0x5.

See section 3.2.2.5 Cause of TS 08.08 for the details.

Change-Id: I46646740c5daaafe20123e709f26dd1d2c1b6f8d
---
M include/osmocom/gsm/gsm0808_utils.h
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/18230/1

diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h
index 1cdca8c..a8852e4 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -145,7 +145,7 @@
 /*! \returns 3GPP TS 08.08 §3.2.2.5 Class of a given Cause */
 static inline enum gsm0808_cause_class gsm0808_cause_class(enum gsm0808_cause cause)
 {
-	return (cause << 1) >> 4;
+	return (cause >> 4) & 0x7;
 }
 
 /*! \returns true if 3GPP TS 08.08 §3.2.2.5 Class has extended bit set */

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I46646740c5daaafe20123e709f26dd1d2c1b6f8d
Gerrit-Change-Number: 18230
Gerrit-PatchSet: 1
Gerrit-Owner: ipse <Alexander.Chemeris at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200512/cb301757/attachment.htm>


More information about the gerrit-log mailing list