[PATCH] libosmocore[master]: gsm48_hdr_msg_type[_r99]: Fix bit-masks

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Feb 3 20:17:56 UTC 2018


Review at  https://gerrit.osmocom.org/6265

gsm48_hdr_msg_type[_r99]: Fix bit-masks

TS 24.007 is quite clear: The upper two bits of the message type
octet are *not* part of the message type in any of the L3 protocols
which implement sequence numbers.  it doesn't matter if it's R98 or
R99, or whether the sequence number is 1bit or 2bits wide.

Related: OS#2908
Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/65/6265/1

diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h
index e54084f..4fb8a7f 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1001,7 +1001,7 @@
 	case GSM48_PDISC_GROUP_CC:
 	case GSM48_PDISC_BCAST_CC:
 	case GSM48_PDISC_LOC:
-		return hdr->msg_type & 0xbf;
+		return hdr->msg_type & 0x3f;
 	default:
 		return hdr->msg_type;
 	}
@@ -1022,7 +1022,7 @@
 	case GSM48_PDISC_GROUP_CC:
 	case GSM48_PDISC_BCAST_CC:
 	case GSM48_PDISC_LOC:
-		return hdr->msg_type & 0xbf;
+		return hdr->msg_type & 0x3f;
 	default:
 		return hdr->msg_type;
 	}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list