[MERGED] libosmocore[master]: Revert "gsm48: move to hex TMSI representation"

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/OpenBSC@lists.osmocom.org/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Fri May 20 19:42:50 UTC 2016


Holger Freyther has submitted this change and it was merged.

Change subject: Revert "gsm48: move to hex TMSI representation"
......................................................................


Revert "gsm48: move to hex TMSI representation"

This is a "flag" day change. Old OpenBSC break with new libosmocore
because suddenly there is the 0x in front. I am afraid we need to
find a better solution here. I think we will need to create a
gsm48_mi_to_string variant that takes a mode parameter to enable the
TMSI mode and deprecate the old method.

Right now we should not break old versions of OpenBSC.

This reverts commit 78ad042f94afd5bf7de477ae634e9d2fdd9c9dc4.

Change-Id: I2f61e626f2f9088b492e1b643c3dcc9bce77d52b
Reviewed-on: https://gerrit.osmocom.org/86
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger at freyther.de>
---
M src/gsm/gsm48.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Holger Freyther: Looks good to me, approved



diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index d0e050b..8a46f76 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -458,10 +458,11 @@
 	case GSM_MI_TYPE_NONE:
 		break;
 	case GSM_MI_TYPE_TMSI:
+		/* Table 10.5.4.3, reverse generate_mid_from_tmsi */
 		if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) {
 			memcpy(&tmsi, &mi[1], 4);
 			tmsi = ntohl(tmsi);
-			return snprintf(string, str_len, "0x%08X", tmsi);
+			return snprintf(string, str_len, "%u", tmsi);
 		}
 		break;
 	case GSM_MI_TYPE_IMSI:

-- 
To view, visit https://gerrit.osmocom.org/86
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f61e626f2f9088b492e1b643c3dcc9bce77d52b
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the OpenBSC mailing list