From 143aed7fa61adac6db7c7b628351cacd7a7f0cf6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 3 Feb 2018 21:14:47 +0100 Subject: 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 --- include/osmocom/gsm/protocol/gsm_04_08.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index e54084f0..4fb8a7f0 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1001,7 +1001,7 @@ static inline uint8_t gsm48_hdr_msg_type_r98(const struct gsm48_hdr *hdr) 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 @@ static inline uint8_t gsm48_hdr_msg_type_r99(const struct gsm48_hdr *hdr) 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; } -- cgit v1.2.3