aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm_rlcmac.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-10-19 16:48:16 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-10-20 15:36:01 +0200
commitebdc0d8c170ee2dbf23b19056d6c2d0ef316b3c2 (patch)
treedced7389d3c19d8dcf6e52d904a3ee4676b4ee86 /src/gsm_rlcmac.c
parent089d734cd1a8751b796db911cd8d14c2a859ca71 (diff)
csn1: Avoid failing if optional DownlinkDualCarrierCapability_r7 is missing
All additional release fields are considered optional, and the CSN_DESCR for Content_t already marks almost all as such, except DownlinkDualCarrierCapability_r7. It has been found that some MS transmits a MS RA Capability with a Length=61 bits where the last bit in the buffer is setting the Exist bit for DownlinkDualCarrierCapability_r7 as 1. Hence, the CSN1 decoder failed to decode the whole message because it expected to keep reading there despite there's no more bytes to read. While this is could actually be considered an MS bug, let's relax our expectancies and simply consider the case { 1 <end> } as it was { 0 }, and mark skip decoding DownlinkDualCarrierCapability_r7. That waht wireshark (packet-gsm_a_gsm.c) or pycrate do for instance. This patch itself doesn't fix the problem where actually the Exist bit is stored as 1 in the output decoded structure, but simply allows keep ongoing with decoding until the end. This issue will be fixed in a follow-up patch. Related: SYS#5552 Related: OS#4955 Related: OS#5020 Change-Id: I9a2541bd3544802a646890f32725201836abb0da
Diffstat (limited to 'src/gsm_rlcmac.c')
-rw-r--r--src/gsm_rlcmac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gsm_rlcmac.c b/src/gsm_rlcmac.c
index f676645a..6793602c 100644
--- a/src/gsm_rlcmac.c
+++ b/src/gsm_rlcmac.c
@@ -928,7 +928,7 @@ CSN_DESCR_BEGIN (Content_t)
/* additions in release 7 */
M_UINT_OR_NULL (Content_t, DTM_Handover_Capability, 1),
M_NEXT_EXIST_OR_NULL(Content_t, Exist_DownlinkDualCarrierCapability_r7, 1),
- M_TYPE (Content_t, DownlinkDualCarrierCapability_r7, DownlinkDualCarrierCapability_r7_t),
+ M_TYPE_OR_NULL (Content_t, DownlinkDualCarrierCapability_r7, DownlinkDualCarrierCapability_r7_t),
M_UINT_OR_NULL (Content_t, FlexibleTimeslotAssignment, 1),
M_UINT_OR_NULL (Content_t, GAN_PS_HandoverCapability, 1),